Skip to content

Commit

Permalink
Merge pull request #26 from lopezloo/getammofix
Browse files Browse the repository at this point in the history
Fixed getPedTotalAmmo crashing game if incorrect slot ID was passed
  • Loading branch information
Jusonex authored and Jusonex committed Jan 17, 2016
2 parents 3435725 + d691b66 commit 5bda149
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Ped.cpp
Expand Up @@ -233,7 +233,7 @@ int CLuaFunctionDefs::GetPedTotalAmmo ( lua_State* luaVM )
lua_pushnumber ( luaVM, usAmmo );
return 1;
}
else if ( pPed->m_usWeaponAmmo [ ucSlot ] )
else if ( ucSlot < WEAPONSLOT_MAX && pPed->m_usWeaponAmmo [ ucSlot ] )
{
// The ped musn't be streamed in, so we can get the stored value instead
ushort usAmmo = 1;
Expand Down

0 comments on commit 5bda149

Please sign in to comment.