Reporting error on
Superversus of Shao version. (but seems that all versions can throw this error).
Is really rare to happen, the user may have to disconnect less than 1 second after the "tank_spawn"
It has thrown only once in my servers.
Code:
Exception reported: Entity 6 (6) is invalid
Blaming: l4d_superversus.smx
Call stack trace:
[0] SetEntProp
[1] Line 527, l4d_superversus.sp::SetTankHp
To fix it, change these parts here:
Event_TankSpawn
PHP Code:
public Action Event_TankSpawn(Event event, const char[] name, bool dontBroadcast)
{
if(AutoDifficulty.BoolValue) CreateTimer(1.0, SetTankHp, event.GetInt("userid"), TIMER_FLAG_NO_MAPCHANGE );
}
and
SetTankHp
PHP Code:
public Action SetTankHp(Handle hTimer, int userid)
{
int client = GetClientOfUserId(userid);
if (client == 0)
return;
SetEntProp(client,Prop_Send,"m_iHealth", TankHealth.IntValue);
SetEntProp(client,Prop_Send,"m_iMaxHealth", TankHealth.IntValue);
SetEntityHealth(client, TankHealth.IntValue);
}
__________________