summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp6
-rw-r--r--src/control/Script.h2
-rw-r--r--src/control/Script8.cpp3
-rw-r--r--src/control/ScriptCommands.h2
-rw-r--r--src/peds/PedAI.cpp1
5 files changed, 8 insertions, 6 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index c6c13c50..4fa7d71b 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1638,7 +1638,7 @@ const tScriptCommandData commands[] = {
REGISTER_COMMAND(COMMAND_SET_CHAR_ONLY_ALLOWED_TO_SIT_IN_FRONT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_SET_CAR_TILTED_BY_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_GET_WEAPON_TYPE_FOR_PICKUP_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_IS_USING_FIRST_PERSON_WEAPON_CAMERA, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
+ REGISTER_COMMAND(COMMAND_IS_PLAYER_USING_FIRST_PERSON_WEAPON_CAMERA, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""),
REGISTER_COMMAND(COMMAND_1489, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_1490, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_1491, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
@@ -2977,6 +2977,8 @@ int8 CRunningScript::ProcessOneCommand()
retval = ProcessCommands1500To1599(command);
else if (command < 1700)
retval = ProcessCommands1600To1699(command);
+ else
+ script_assert(false);
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
if (command < ARRAY_SIZE(commands)) {
if (commands[command].cond || commands[command].output[0] != ARGTYPE_NONE) {
@@ -5170,7 +5172,7 @@ void CRunningScript::ReturnFromGosubOrFunction()
uint8 nOutputParameters = CTheScripts::Read1ByteFromScript(&m_nIp);
uint8 nLocalsOffset = CTheScripts::Read1ByteFromScript(&m_nIp);
for (int i = 0; i < nOutputParameters; i++)
- ScriptParams[i] = m_anLocalVariables[m_nLocalsPointer + nInputParameters];
+ ScriptParams[i] = m_anLocalVariables[m_nLocalsPointer + nInputParameters + i];
m_nIp += val >> STACKVALUE_IP_PARAMS_OFFSET;
m_nLocalsPointer -= nLocalsOffset;
StoreParameters(&m_nIp, nOutputParameters);
diff --git a/src/control/Script.h b/src/control/Script.h
index 5c31625f..f2b5dda9 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -19,7 +19,7 @@ class CRunningScript;
extern int32 ScriptParams[32];
void FlushLog();
-#define script_assert(_Expression) FlushLog(); assert(_Expression);
+#define script_assert(_Expression) { FlushLog(); assert(_Expression); }
#define PICKUP_PLACEMENT_OFFSET (0.5f)
#define PED_FIND_Z_OFFSET (5.0f)
diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp
index 35cf6fa8..c6e11127 100644
--- a/src/control/Script8.cpp
+++ b/src/control/Script8.cpp
@@ -674,7 +674,8 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
SET_INTEGER_PARAM(0, model);
StoreParameters(&m_nIp, 1);
}
- case COMMAND_IS_USING_FIRST_PERSON_WEAPON_CAMERA:
+ case COMMAND_IS_PLAYER_USING_FIRST_PERSON_WEAPON_CAMERA:
+ CollectParameters(&m_nIp, 1);
UpdateCompareFlag(TheCamera.Using1stPersonWeaponMode());
return 0;
//case COMMAND_1489:
diff --git a/src/control/ScriptCommands.h b/src/control/ScriptCommands.h
index f0d9743b..ce8327ec 100644
--- a/src/control/ScriptCommands.h
+++ b/src/control/ScriptCommands.h
@@ -1489,7 +1489,7 @@ enum {
COMMAND_SET_CHAR_ONLY_ALLOWED_TO_SIT_IN_FRONT,
COMMAND_SET_CAR_TILTED_BY_CHAR,
COMMAND_GET_WEAPON_TYPE_FOR_PICKUP_IN_AREA,
- COMMAND_IS_USING_FIRST_PERSON_WEAPON_CAMERA,
+ COMMAND_IS_PLAYER_USING_FIRST_PERSON_WEAPON_CAMERA,
COMMAND_1489,
COMMAND_1490,
COMMAND_1491,
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index b945cf9b..8b832670 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -6334,7 +6334,6 @@ CPed::PositionAnyPedOutOfCollision(void)
int smallestDistNearVeh = 999;
int smallestDistSomewhereClose = 999;
- CVector vehPos = m_pMyVehicle->GetPosition();
CVector potentialPos;
potentialPos.y = GetPosition().y - 3.5f;
potentialPos.z = GetPosition().z;