Break loop in OLD_CheckBuyZone, OLD_CheckBombTarget, OLD_CheckRescueZone (#141)

stop loop when match is found
This commit is contained in:
justgo97 2017-05-03 23:09:46 +01:00 committed by s1lentq
parent d9eeceaede
commit fed41984d8

View File

@ -6331,7 +6331,12 @@ void OLD_CheckBuyZone(CBasePlayer *player)
while ((pSpot = UTIL_FindEntityByClassname(pSpot, pszSpawnClass))) while ((pSpot = UTIL_FindEntityByClassname(pSpot, pszSpawnClass)))
{ {
if ((pSpot->pev->origin - player->pev->origin).Length() < 200.0f) if ((pSpot->pev->origin - player->pev->origin).Length() < 200.0f)
{
player->m_signals.Signal(SIGNAL_BUY); player->m_signals.Signal(SIGNAL_BUY);
#ifdef REGAMEDLL_FIXES
break;
#endif
}
} }
} }
} }
@ -6342,7 +6347,12 @@ void OLD_CheckBombTarget(CBasePlayer *player)
while ((pSpot = UTIL_FindEntityByClassname(pSpot, "info_bomb_target"))) while ((pSpot = UTIL_FindEntityByClassname(pSpot, "info_bomb_target")))
{ {
if ((pSpot->pev->origin - player->pev->origin).Length() <= 256.0f) if ((pSpot->pev->origin - player->pev->origin).Length() <= 256.0f)
{
player->m_signals.Signal(SIGNAL_BOMB); player->m_signals.Signal(SIGNAL_BOMB);
#ifdef REGAMEDLL_FIXES
break;
#endif
}
} }
} }
@ -6352,7 +6362,12 @@ void OLD_CheckRescueZone(CBasePlayer *player)
while ((pSpot = UTIL_FindEntityByClassname(pSpot, "info_hostage_rescue"))) while ((pSpot = UTIL_FindEntityByClassname(pSpot, "info_hostage_rescue")))
{ {
if ((pSpot->pev->origin - player->pev->origin).Length() <= 256.0f) if ((pSpot->pev->origin - player->pev->origin).Length() <= 256.0f)
{
player->m_signals.Signal(SIGNAL_RESCUE); player->m_signals.Signal(SIGNAL_RESCUE);
#ifdef REGAMEDLL_FIXES
break;
#endif
}
} }
} }