BossHP: fix bugs
This commit is contained in:
parent
2a0a3d39ee
commit
e399b1eda7
@ -62,6 +62,11 @@ public void OnPluginEnd()
|
|||||||
|
|
||||||
void Cleanup()
|
void Cleanup()
|
||||||
{
|
{
|
||||||
|
for(int entity = 0; entity < sizeof(g_aHurtEntityToBossIdx); entity++)
|
||||||
|
{
|
||||||
|
g_aHurtEntityToBossIdx[entity] = 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
if(g_aBoss)
|
if(g_aBoss)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_aBoss.Length; i++)
|
for(int i = 0; i < g_aBoss.Length; i++)
|
||||||
@ -369,6 +374,11 @@ public void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
|
|||||||
if(!g_aConfig)
|
if(!g_aConfig)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
for(int entity = 0; entity < sizeof(g_aHurtEntityToBossIdx); entity++)
|
||||||
|
{
|
||||||
|
g_aHurtEntityToBossIdx[entity] = 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
if(g_aBoss)
|
if(g_aBoss)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_aBoss.Length; i++)
|
for(int i = 0; i < g_aBoss.Length; i++)
|
||||||
@ -759,6 +769,7 @@ void OnKillTrigger(int entity, const char[] output, SDKHookType HookType = view_
|
|||||||
|
|
||||||
delete Boss;
|
delete Boss;
|
||||||
g_aBoss.Erase(j);
|
g_aBoss.Erase(j);
|
||||||
|
OnBossDeleted(j);
|
||||||
j--;
|
j--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -872,6 +883,7 @@ public void OnGameFrame()
|
|||||||
|
|
||||||
delete Boss;
|
delete Boss;
|
||||||
g_aBoss.Erase(i);
|
g_aBoss.Erase(i);
|
||||||
|
OnBossDeleted(i);
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -907,15 +919,9 @@ public void OnGameFrame()
|
|||||||
|
|
||||||
delete Boss;
|
delete Boss;
|
||||||
g_aBoss.Erase(i);
|
g_aBoss.Erase(i);
|
||||||
|
OnBossDeleted(i);
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
// TODO: Unhook instead of this
|
|
||||||
for(int entity = 0; entity < sizeof(g_aHurtEntityToBossIdx); entity++)
|
|
||||||
{
|
|
||||||
if(g_aHurtEntityToBossIdx[entity] == i)
|
|
||||||
g_aHurtEntityToBossIdx[entity] = 0xFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1267,8 +1273,6 @@ bool BossInit(int iBoss, CBoss _Boss)
|
|||||||
|
|
||||||
if(sHurtTrigger[0])
|
if(sHurtTrigger[0])
|
||||||
{
|
{
|
||||||
Format(sHurtTrigger, sizeof(sHurtTrigger), "%s&%04d", sHurtTrigger, iTemplateNum);
|
|
||||||
|
|
||||||
char sHurtOutput[64];
|
char sHurtOutput[64];
|
||||||
_Config.GetHurtOutput(sHurtOutput, sizeof(sHurtOutput));
|
_Config.GetHurtOutput(sHurtOutput, sizeof(sHurtOutput));
|
||||||
|
|
||||||
@ -1479,3 +1483,12 @@ int FindEntityByTargetname(int entity, const char[] sTargetname, const char[] sC
|
|||||||
|
|
||||||
return INVALID_ENT_REFERENCE;
|
return INVALID_ENT_REFERENCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnBossDeleted(int iBoss)
|
||||||
|
{
|
||||||
|
for(int entity = 0; entity < sizeof(g_aHurtEntityToBossIdx); entity++)
|
||||||
|
{
|
||||||
|
if(g_aHurtEntityToBossIdx[entity] == iBoss)
|
||||||
|
g_aHurtEntityToBossIdx[entity] = 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user