summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-10-31 00:00:04 +0100
committereray orçunus <erayorcunus@gmail.com>2019-11-01 10:32:31 +0100
commit5bb217fcb6447765cf71da35927e712aa8f3ea6e (patch)
tree937135856409f9c9d97425a4950fbdf1ff58f199 /src/control/Script.cpp
parentMerge branch 'master' of git://github.com/GTAmodding/re3 into erorcun (diff)
downloadre3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.tar
re3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.tar.gz
re3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.tar.bz2
re3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.tar.lz
re3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.tar.xz
re3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.tar.zst
re3-5bb217fcb6447765cf71da35927e712aa8f3ea6e.zip
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 6d805510..0b5f1105 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -4676,7 +4676,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command)
CollectParameters(&m_nIp, 2);
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
assert(pPed);
- pPed->m_fHealth = *(float*)&ScriptParams[1];
+ pPed->m_fHealth = ScriptParams[1];
return 0;
}
case COMMAND_SET_CHAR_HEALTH:
@@ -4684,9 +4684,8 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command)
CollectParameters(&m_nIp, 2);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pPed);
- float health = *(float*)&ScriptParams[1];
- if (health != 0.0f) {
- pPed->m_fHealth = *(float*)&ScriptParams[1];
+ if (ScriptParams[1]) {
+ pPed->m_fHealth = ScriptParams[1];
}
else if (pPed->bInVehicle) {
pPed->SetDead();
@@ -4703,7 +4702,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command)
CollectParameters(&m_nIp, 2);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
- pVehicle->m_fHealth = *(float*)&ScriptParams[1];
+ pVehicle->m_fHealth = ScriptParams[1];
return 0;
}
case COMMAND_GET_PLAYER_HEALTH:
@@ -4839,7 +4838,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command)
CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pSourcePed);
pSourcePed->ClearLookFlag();
- pSourcePed->bIsRestoringLook = false;
+ pSourcePed->bKeepTryingToLook = false;
if (pSourcePed->GetPedState() == PED_LOOK_HEADING || pSourcePed->GetPedState() == PED_LOOK_ENTITY)
pSourcePed->RestorePreviousState();
return 0;
@@ -4850,7 +4849,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command)
CPed* pSourcePed = CWorld::Players[ScriptParams[0]].m_pPed;
assert(pSourcePed);
pSourcePed->ClearLookFlag();
- pSourcePed->bIsRestoringLook = false;
+ pSourcePed->bKeepTryingToLook = false;
if (pSourcePed->GetPedState() == PED_LOOK_HEADING || pSourcePed->GetPedState() == PED_LOOK_ENTITY)
pSourcePed->RestorePreviousState();
return 0;