I am getting an error with my witch plugin that I think happens when the witch dies.
PHP Code:
L 05/19/2022 - 22:16:59: Info (map "c1m4_atrium") (file "/home/l4d2/l4d2ds2/left4dead2/addons/sourcemod/logs/errors_20220519.log")
L 05/19/2022 - 22:16:59: [SM] Plugin "optional/l4d_witch_incap.smx" encountered error 23: Native detected error
L 05/19/2022 - 22:16:59: [SM] Invalid timer handle 5d500671 (error 3) during timer end, displayed function is timer callback, not the stack trace
L 05/19/2022 - 22:16:59: [SM] Unable to call function "BurnWitchDead_Timer" due to above error(s).
My code is (which is modified from a few other peoples plugins):
PHP Code:
public Action OnTakeDamageWitch(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
if (1 <= attacker <= MaxClients && GetClientTeam(attacker) == 3 && !IsWitchIdle(victim))
{
damage = 0.0;
#if debug
PrintToChatAll("[Witch Status] Prevented SI from damaging witch.");
#endif
return Plugin_Changed;
}
if( damagetype & DMG_BURN && BurnWitchTimer[victim] == null)
{
BurnWitchTimer[victim] = CreateTimer(witch_burn_time, BurnWitchDead_Timer, victim);
}
return Plugin_Continue;
}
public Action BurnWitchDead_Timer(Handle timer, any witch)
{
if ( witch )
{
if(IsWitch(witch))
{
ForceDamageEntity(-1, 99999, witch);
BurnWitchTimer[witch] = null;
}
}
return Plugin_Continue;
}
There is a lot more happening in the plugin, so let me know if you need to see more of it.
EDIT: figured this out. Was trying to delete the BurnWitchTimer[witch] on the witch killed event, but it wasn't needed. Error is gone now.