FixPointTeleport: Only called while constrained.

This commit is contained in:
zaCade 2017-11-05 00:59:15 +01:00
parent 1cac46a063
commit df54cbab4b

View File

@ -4,6 +4,8 @@
#include <sdktools>
#include <dhooks>
#define SF_WEAPON_START_CONSTRAINED (1<<0)
Handle hFallInit;
Handle hTeleport;
@ -90,6 +92,10 @@ public MRESReturn OnEntityTeleport(int entity, Handle hParams)
{
if (IsValidEntity(entity))
{
// Dont reinitialize, if we dont spawnflags or are missing the start constrained spawnflag.
if (!HasEntProp(entity, Prop_Data, "m_spawnflags") || (GetEntProp(entity, Prop_Data, "m_spawnflags") & SF_WEAPON_START_CONSTRAINED) == 0)
return;
SDKCall(hFallInit, entity);
}
}