Possible fix for amb149 - register_event with "e" triggers false positives for dead players not fully in game.

This commit is contained in:
Steve Dudenhoeffer 2007-06-22 16:51:16 +00:00
parent 3f268e5f2e
commit e23f3747ba

View File

@ -237,11 +237,31 @@ void EventsMngr::parserInit(int msg_type, float* timer, CPlayer* pPlayer, int in
if (pPlayer) if (pPlayer)
{ {
if (!(*iter).m_FlagPlayer || (pPlayer->IsAlive() ? !(*iter).m_FlagAlive : !(*iter).m_FlagDead)) // seriously who writes an if statement like this
// if (!(*iter).m_FlagPlayer || (pPlayer->IsAlive() ? !(*iter).m_FlagAlive : !(*iter).m_FlagDead))
if (!(*iter).m_FlagPlayer)
{ {
(*iter).m_Done = true; (*iter).m_Done = true;
continue; continue;
} }
else if ((*iter).m_FlagAlive) // can only be sent to an alive user
{
if (!pPlayer->IsAlive() ||
!pPlayer->ingame) // fix for amb149 - is_user_alive checks ingame status, so this should too
{
(*iter).m_Done = true;
continue;
}
}
else if ((*iter).m_FlagDead) // can only be sent to "dead" users
{
if (pPlayer->IsAlive() &&
pPlayer->ingame) // added to compliment amb149 fix: check both incase there is stale health data
{
(*iter).m_Done = true;
continue;
}
}
} }
else if (!(*iter).m_FlagWorld) else if (!(*iter).m_FlagWorld)
{ {