diff --git a/FixPointTeleport/scripting/FixPointTeleport.sp b/FixPointTeleport/scripting/FixPointTeleport.sp index a96126d3..81d2b6ad 100644 --- a/FixPointTeleport/scripting/FixPointTeleport.sp +++ b/FixPointTeleport/scripting/FixPointTeleport.sp @@ -4,8 +4,8 @@ #include #include -Handle hTeleport; Handle hFallInit; +Handle hTeleport; //---------------------------------------------------------------------------------------------------- // Purpose: @@ -64,7 +64,7 @@ public void OnPluginStart() // Late load. int entity = INVALID_ENT_REFERENCE; - while((entity = FindEntityByClassname(entity, "weapon_*")) != INVALID_ENT_REFERENCE) + while ((entity = FindEntityByClassname(entity, "weapon_*")) != INVALID_ENT_REFERENCE) { OnEntityCreated(entity, "weapon_*"); } @@ -88,5 +88,8 @@ public void OnEntityCreated(int entity, const char[] classname) //---------------------------------------------------------------------------------------------------- public MRESReturn OnEntityTeleport(int entity, Handle hParams) { - SDKCall(hFallInit, entity); + if (IsValidEntity(entity)) + { + SDKCall(hFallInit, entity); + } } \ No newline at end of file