summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/control/Script.cpp3
-rw-r--r--src/control/Script.h6
-rw-r--r--src/core/Pad.cpp26
-rw-r--r--src/core/config.h1
-rw-r--r--src/entities/Physical.cpp30
5 files changed, 61 insertions, 5 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index c560e500..5cd20001 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2239,7 +2239,6 @@ void CTheScripts::Init()
StoreVehicleWasRandom = true;
OnAMissionFlag = 0;
LastMissionPassedTime = (uint32)-1;
- NextFreeCollectiveIndex = 0;
LastRandomPedId = -1;
for (int i = 0; i < MAX_NUM_USED_OBJECTS; i++){
memset(&UsedObjectArray[i].name, 0, sizeof(UsedObjectArray[i].name));
@@ -16138,7 +16137,7 @@ void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
MainScriptSize = Read4BytesFromScript(&ip);
LargestMissionScriptSize = Read4BytesFromScript(&ip);
NumberOfMissionScripts = Read2BytesFromScript(&ip);
- ip += 2;
+ NumberOfExclusiveMissionScripts = Read2BytesFromScript(&ip);
for (int i = 0; i < NumberOfMissionScripts; i++) {
MultiScriptArray[i] = Read4BytesFromScript(&ip);
}
diff --git a/src/control/Script.h b/src/control/Script.h
index f3455797..c7218847 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -37,7 +37,7 @@ struct intro_script_rectangle
VALIDATE_SIZE(intro_script_rectangle, 0x18);
enum {
- SCRIPT_TEXT_MAX_LENGTH = 500
+ SCRIPT_TEXT_MAX_LENGTH = 100
};
struct intro_text_line
@@ -227,7 +227,11 @@ enum {
};
enum {
+#ifdef PS2
+ SIZE_MAIN_SCRIPT = 205512,
+#else
SIZE_MAIN_SCRIPT = 225512,
+#endif
SIZE_MISSION_SCRIPT = 35000,
SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
};
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 193ca1c5..03d209cd 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -89,6 +89,10 @@ bool CPad::IsAffectedByController = false;
_TODO("gbFastTime");
extern bool gbFastTime;
+#ifdef WALLCLIMB_CHEAT
+extern bool gGravityCheat;
+#endif
+
void WeaponCheat1()
{
CHud::SetHelpMessage(TheText.Get("CHEAT2"), true);
@@ -554,6 +558,22 @@ void AltDodoCheat(void)
}
#endif
+#ifdef WALLCLIMB_CHEAT
+void WallClimbingCheat(void)
+{
+ wchar* string;
+ if (gGravityCheat) {
+ string = TheText.Get("CHEATOF");
+ gGravityCheat = false;
+ }
+ else {
+ string = TheText.Get("CHEAT1");
+ gGravityCheat = true;
+ }
+ CHud::SetHelpMessage(string, true);
+}
+#endif
+
void FlyingFishCheat(void)
{
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
@@ -1430,6 +1450,12 @@ void CPad::AddToPCCheatString(char c)
AltDodoCheat();
#endif
+#ifdef WALLCLIMB_CHEAT
+ // "SPIDERCAR"
+ if (!_CHEATCMP("RACREDIPS"))
+ WallClimbingCheat();
+#endif
+
#if !defined(PC_WATER) && defined(WATER_CHEATS)
// SEABEDCHEAT
if (!_CHEATCMP("TAEHCDEBAESON"))
diff --git a/src/core/config.h b/src/core/config.h
index 276ddefd..82044f75 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -252,6 +252,7 @@ enum Config {
#define KANGAROO_CHEAT
#define ALLCARSHELI_CHEAT
#define ALT_DODO_CHEAT
+#define WALLCLIMB_CHEAT
#define REGISTER_START_BUTTON
//#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp
index 5fe29a79..b190d03a 100644
--- a/src/entities/Physical.cpp
+++ b/src/entities/Physical.cpp
@@ -23,6 +23,11 @@
//--MIAMI: file done
+#ifdef WALLCLIMB_CHEAT
+bool gGravityCheat;
+#endif
+
+
CPhysical::CPhysical(void)
{
int i;
@@ -521,8 +526,29 @@ CPhysical::ApplySpringDampening(float damping, CVector &springDir, CVector &poin
void
CPhysical::ApplyGravity(void)
{
- if(bAffectedByGravity)
- m_vecMoveSpeed.z -= GRAVITY * CTimer::GetTimeStep();
+ if (!bAffectedByGravity)
+ return;
+#ifdef WALLCLIMB_CHEAT
+ if (gGravityCheat && this == FindPlayerVehicle()) {
+ static CVector v1(0.0f, 0.0f, 1.0f), v2(0.0f, 0.0f, 1.0f);
+ CVector prop = GetPosition() - (GetUp() + GetUp());
+ CColPoint point;
+ CEntity* entity;
+ if (CWorld::ProcessLineOfSight(GetPosition(), prop, point, entity, true, false, false, false, false, false))
+ v2 = point.normal;
+ else
+ v2 = CVector(0.0f, 0.0f, 1.0f);
+ float coef = clamp(CTimer::GetTimeStep() * 0.5f, 0.05f, 0.8f);
+ v1 = v1 * (1.0f - coef) + v2 * coef;
+ if (v1.MagnitudeSqr() < 0.1f)
+ v1 = CVector(0.0f, 0.0f, 1.0f);
+ else
+ v1.Normalise();
+ m_vecMoveSpeed -= GRAVITY * CTimer::GetTimeStep() * v1;
+ return;
+ }
+#endif
+ m_vecMoveSpeed.z -= GRAVITY * CTimer::GetTimeStep();
}
void