summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-06 18:26:04 +0200
committerGitHub <noreply@github.com>2020-04-06 18:26:04 +0200
commitb991fd9766c77354454c76c906f7806680605500 (patch)
treef7425645eb83088646a72b713cd08a665947650e /src/control/Script.cpp
parentImplement Init for Stats (diff)
parentfixed look behind bug (diff)
downloadre3-b991fd9766c77354454c76c906f7806680605500.tar
re3-b991fd9766c77354454c76c906f7806680605500.tar.gz
re3-b991fd9766c77354454c76c906f7806680605500.tar.bz2
re3-b991fd9766c77354454c76c906f7806680605500.tar.lz
re3-b991fd9766c77354454c76c906f7806680605500.tar.xz
re3-b991fd9766c77354454c76c906f7806680605500.tar.zst
re3-b991fd9766c77354454c76c906f7806680605500.zip
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp57
1 files changed, 16 insertions, 41 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 4aeacf3f..f96ec060 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1,3 +1,4 @@
+#define WITHWINDOWS // for our script loading hack
#include "common.h"
#include "patcher.h"
@@ -52,6 +53,8 @@
#include "Restart.h"
#include "Replay.h"
#include "RpAnimBlend.h"
+#include "AnimBlendAssociation.h"
+#include "Fire.h"
#include "Rubbish.h"
#include "Shadows.h"
#include "SpecialFX.h"
@@ -64,6 +67,7 @@
#include "Weather.h"
#include "World.h"
#include "Zones.h"
+#include "Radar.h"
#define PICKUP_PLACEMENT_OFFSET 0.5f
#define PED_FIND_Z_OFFSET 5.0f
@@ -2838,9 +2842,6 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
return -1;
}
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommand300To399(int32 command) { EAXJMP(0x43ED30); }
-#else
int8 CRunningScript::ProcessCommands300To399(int32 command)
{
switch (command) {
@@ -3072,7 +3073,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
{
CollectParameters(&m_nIp, 3);
// ScriptParams[0] is unused.
- TheCamera.TakeControl(nil, ScriptParams[1], ScriptParams[2], CAM_CONTROLLER_1);
+ TheCamera.TakeControl(nil, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_POINT_CAMERA_AT_CAR:
@@ -3080,7 +3081,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CollectParameters(&m_nIp, 3);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
- TheCamera.TakeControl(pVehicle, ScriptParams[1], ScriptParams[2], CAM_CONTROLLER_1);
+ TheCamera.TakeControl(pVehicle, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_POINT_CAMERA_AT_CHAR:
@@ -3088,7 +3089,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CollectParameters(&m_nIp, 3);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pPed);
- TheCamera.TakeControl(pPed, ScriptParams[1], ScriptParams[2], CAM_CONTROLLER_1);
+ TheCamera.TakeControl(pPed, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_RESTORE_CAMERA:
@@ -3139,7 +3140,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CVector pos = *(CVector*)&ScriptParams[0];
if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
- TheCamera.TakeControlNoEntity(pos, ScriptParams[3], CAM_CONTROLLER_1);
+ TheCamera.TakeControlNoEntity(pos, ScriptParams[3], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_ADD_BLIP_FOR_CAR_OLD:
@@ -3572,11 +3573,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
}
return -1;
}
-#endif
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommands400To499(int32 command) { EAXJMP(0x440CB0); }
-#else
int8 CRunningScript::ProcessCommands400To499(int32 command)
{
switch (command) {
@@ -4366,11 +4363,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
}
return -1;
}
-#endif
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommands500To599(int32 command) { EAXJMP(0x4429C0); }
-#else
int8 CRunningScript::ProcessCommands500To599(int32 command)
{
switch (command) {
@@ -4629,7 +4622,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
infZ = *(float*)&ScriptParams[5];
supZ = *(float*)&ScriptParams[2];
}
- ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, ScriptParams[6], 0);
+ ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, (eGarageType)ScriptParams[6], 0);
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -4654,7 +4647,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
infZ = *(float*)&ScriptParams[5];
supZ = *(float*)&ScriptParams[2];
}
- ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, ScriptParams[6], ScriptParams[7]);
+ ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, (eGarageType)ScriptParams[6], ScriptParams[7]);
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -4678,7 +4671,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
return 0;
case COMMAND_SET_FREE_BOMBS:
CollectParameters(&m_nIp, 1);
- CGarages::BombsAreFree = (ScriptParams[0] != 0);
+ CGarages::SetFreeBombs(ScriptParams[0] != 0);
return 0;
#ifdef GTA_PS2
case COMMAND_SET_POWERPOINT:
@@ -5197,11 +5190,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
}
return -1;
}
-#endif
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommands600To699(int32 command) { EAXJMP(0x444B20); }
-#else
int8 CRunningScript::ProcessCommands600To699(int32 command)
{
switch (command){
@@ -5555,11 +5544,7 @@ int8 CRunningScript::ProcessCommands600To699(int32 command)
}
return -1;
}
-#endif
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommands700To799(int32 command) { EAXJMP(0x4458A0); }
-#else
int8 CRunningScript::ProcessCommands700To799(int32 command)
{
switch (command){
@@ -6425,11 +6410,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
}
return -1;
}
-#endif
-
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommands800To899(int32 command) { EAXJMP(0x448240); }
-#else
int8 CRunningScript::ProcessCommands800To899(int32 command)
{
CMatrix tmp_matrix;
@@ -6682,7 +6662,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
}
case COMMAND_SET_FREE_RESPRAYS:
CollectParameters(&m_nIp, 1);
- CGarages::RespraysAreFree = (ScriptParams[0] != 0);
+ CGarages::SetFreeResprays(ScriptParams[0] != 0);
return 0;
case COMMAND_SET_PLAYER_VISIBLE:
{
@@ -7130,13 +7110,13 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
case COMMAND_OPEN_GARAGE:
{
CollectParameters(&m_nIp, 1);
- CGarages::Garages[ScriptParams[0]].OpenThisGarage();
+ CGarages::OpenGarage(ScriptParams[0]);
return 0;
}
case COMMAND_CLOSE_GARAGE:
{
CollectParameters(&m_nIp, 1);
- CGarages::Garages[ScriptParams[0]].CloseThisGarage();
+ CGarages::CloseGarage(ScriptParams[1]);
return 0;
}
case COMMAND_WARP_CHAR_FROM_CAR_TO_COORD:
@@ -7511,11 +7491,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
}
return -1;
}
-#endif
-#if 0
-WRAPPER int8 CRunningScript::ProcessCommands900To999(int32 command) { EAXJMP(0x44CB80); }
-#else
int8 CRunningScript::ProcessCommands900To999(int32 command)
{
char str[52];
@@ -8416,7 +8392,6 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
}
return -1;
}
-#endif
int8 CRunningScript::ProcessCommands1000To1099(int32 command)
{
@@ -9815,7 +9790,7 @@ void CTheScripts::UndoBuildingSwaps()
}
}
-void CTheScripts::UndoEntityVisibilitySettings()
+void CTheScripts::UndoEntityInvisibilitySettings()
{
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
if (InvisibilitySettingArray[i]) {
@@ -11653,7 +11628,7 @@ InjectHook(0x439040, &CTheScripts::Process, PATCH_JUMP);
InjectHook(0x439400, &CTheScripts::StartTestScript, PATCH_JUMP);
InjectHook(0x439410, &CTheScripts::IsPlayerOnAMission, PATCH_JUMP);
InjectHook(0x44FD10, &CTheScripts::UndoBuildingSwaps, PATCH_JUMP);
-InjectHook(0x44FD60, &CTheScripts::UndoEntityVisibilitySettings, PATCH_JUMP);
+InjectHook(0x44FD60, &CTheScripts::UndoEntityInvisibilitySettings, PATCH_JUMP);
InjectHook(0x4534E0, &CTheScripts::ScriptDebugLine3D, PATCH_JUMP);
InjectHook(0x453550, &CTheScripts::RenderTheScriptDebugLines, PATCH_JUMP);
InjectHook(0x4535E0, &CTheScripts::SaveAllScripts, PATCH_JUMP);