diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 98c3b27..99ace84 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -625,9 +625,5 @@ void InstallPreHooks() { std::memset(&Player::fakeHealth, 255, sizeof(Player::fakeHealth)); std::memset(&Player::fakeArmour, 255, sizeof(Player::fakeArmour)); - - for (int i = 0; i < 1000; i++) - { - Player::fakeQuat[i] = 0; - } + std::memset(&Player::fakeQuat[0], NULL, sizeof(Player::fakeQuat)); } diff --git a/src/Scripting.cpp b/src/Scripting.cpp index f49f893..d1009bb 100644 --- a/src/Scripting.cpp +++ b/src/Scripting.cpp @@ -234,9 +234,14 @@ static cell AMX_NATIVE_CALL SetFakeFacingAngle(AMX *amx, cell *params) if(!IsPlayerConnected(playerid)) return 0; + if (Player::fakeQuat[playerid]) + { + delete Player::fakeQuat[playerid]; + } + if ((int)params[2] == 0x7FFFFFFF) { - Player::fakeQuat[playerid] = NULL; + Player::fakeQuat[playerid] = nullptr; } else {