diff options
author | erorcun <erayorcunus@gmail.com> | 2019-11-01 13:40:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-01 13:40:28 +0100 |
commit | e7c06a004bdab34acd4857f5fe328b5b953de149 (patch) | |
tree | 937135856409f9c9d97425a4950fbdf1ff58f199 /src/control/Script.cpp | |
parent | Merge pull request #255 from Nick007J/master (diff) | |
parent | Script fix (diff) | |
download | re3-e7c06a004bdab34acd4857f5fe328b5b953de149.tar re3-e7c06a004bdab34acd4857f5fe328b5b953de149.tar.gz re3-e7c06a004bdab34acd4857f5fe328b5b953de149.tar.bz2 re3-e7c06a004bdab34acd4857f5fe328b5b953de149.tar.lz re3-e7c06a004bdab34acd4857f5fe328b5b953de149.tar.xz re3-e7c06a004bdab34acd4857f5fe328b5b953de149.tar.zst re3-e7c06a004bdab34acd4857f5fe328b5b953de149.zip |
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r-- | src/control/Script.cpp | 13 |
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; |