summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-11-01 20:35:46 +0100
committerRoman Masanin <36927roma@gmail.com>2020-11-01 20:35:46 +0100
commit55c43466100e4e79af95500f64513c49d7242877 (patch)
tree2376e54398c53697c07bd6809b9648d561516881 /src/control
parentFix build and use enum in ProcessPlayerMood (diff)
parentfixed KYFC (diff)
downloadre3-55c43466100e4e79af95500f64513c49d7242877.tar
re3-55c43466100e4e79af95500f64513c49d7242877.tar.gz
re3-55c43466100e4e79af95500f64513c49d7242877.tar.bz2
re3-55c43466100e4e79af95500f64513c49d7242877.tar.lz
re3-55c43466100e4e79af95500f64513c49d7242877.tar.xz
re3-55c43466100e4e79af95500f64513c49d7242877.tar.zst
re3-55c43466100e4e79af95500f64513c49d7242877.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Pickups.cpp6
-rw-r--r--src/control/Script.cpp34
2 files changed, 31 insertions, 9 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 8b8bc1a3..2a5863f1 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -1014,8 +1014,11 @@ CPickups::DoPickUpEffects(CEntity *entity)
float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800));
float modifiedSin = 0.3f * (s + 1.0f);
-
+#ifdef FIX_BUGS
+ int16 colorId = 0;
+#else
int16 colorId;
+#endif
bool doInnerGlow = false;
bool doOuterGlow = true;
@@ -1029,7 +1032,6 @@ CPickups::DoPickUpEffects(CEntity *entity)
doInnerGlow = true;
doOuterGlow = false;
} else if (entity->GetModelIndex() == MI_PICKUP_INFO || entity->GetModelIndex() == MI_PICKUP_KILLFRENZY) {
- colorId = WEAPONTYPE_TOTALWEAPONS + 2;
doInnerGlow = true;
doOuterGlow = false;
} else if (entity->GetModelIndex() == MI_PICKUP_HEALTH || entity->GetModelIndex() == MI_PICKUP_BONUS) {
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 86c9e86e..f85fc076 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2488,7 +2488,7 @@ int8 CRunningScript::ProcessOneCommand()
if (commands[command].position == -1)
strcat(commandInfo, commands[command].name + sizeof("COMMAND_") - 1);
for (int i = 0; commands[command].input[i] != ARGTYPE_NONE; i++) {
- char tmp[16];
+ char tmp[32];
bool var = false;
int value;
switch (commands[command].input[i]) {
@@ -2552,7 +2552,7 @@ int8 CRunningScript::ProcessOneCommand()
m_nIp = ip;
ip = t;
for (int i = 0; commands[command].output[i] != ARGTYPE_NONE; i++) {
- char tmp[16];
+ char tmp[32];
switch (commands[command].output[i]) {
case ARGTYPE_INT:
case ARGTYPE_PED_HANDLE:
@@ -5171,7 +5171,12 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CollectParameters(&m_nIp, 1);
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
float angle = pPed->bInVehicle ? pPed->m_pMyVehicle->GetForward().Heading() : pPed->GetForward().Heading();
- *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
+ angle = RADTODEG(angle);
+ if (angle < 0.0f)
+ angle += 360.0f;
+ if (angle > 360.0f)
+ angle -= 360.0f;
+ *(float*)&ScriptParams[0] = angle;
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -5192,7 +5197,12 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed);
float angle = pPed->bInVehicle ? pPed->m_pMyVehicle->GetForward().Heading() : pPed->GetForward().Heading();
- *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
+ angle = RADTODEG(angle);
+ if (angle < 0.0f)
+ angle += 360.0f;
+ if (angle > 360.0f)
+ angle -= 360.0f;
+ *(float*)&ScriptParams[0] = angle;
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -5213,7 +5223,12 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
script_assert(pVehicle);
float angle = pVehicle->GetForward().Heading();
- *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
+ angle = RADTODEG(angle);
+ if (angle < 0.0f)
+ angle += 360.0f;
+ if (angle > 360.0f)
+ angle -= 360.0f;
+ *(float*)&ScriptParams[0] = angle;
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -5231,7 +5246,12 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
script_assert(pObject);
float angle = pObject->GetForward().Heading();
- *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
+ angle = RADTODEG(angle);
+ if (angle < 0.0f)
+ angle += 360.0f;
+ if (angle > 360.0f)
+ angle -= 360.0f;
+ *(float*)&ScriptParams[0] = angle;
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -13225,7 +13245,7 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command)
}
case COMMAND_CLEAR_CHAR_FOLLOW_PATH:
{
- CollectParameters(&m_nIp, 2);
+ CollectParameters(&m_nIp, 1);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed);
if (pPed->GetPedState() == PED_FOLLOW_PATH) {