mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 07:35:40 +03:00
Fixed crash bot when can see a loose bomb but didn't get closest area for bomb
This commit is contained in:
parent
991573f165
commit
d3c0ec8aeb
@ -1452,6 +1452,7 @@ void CCSBotManager::SetLooseBomb(CBaseEntity *bomb)
|
|||||||
if (bomb)
|
if (bomb)
|
||||||
{
|
{
|
||||||
m_looseBombArea = TheNavAreaGrid.GetNearestNavArea(&bomb->pev->origin);
|
m_looseBombArea = TheNavAreaGrid.GetNearestNavArea(&bomb->pev->origin);
|
||||||
|
DbgAssert(m_looseBombArea); // TODO: Need investigation and find out why it cannot find nearest area for a lost bomb, just catch it
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -95,10 +95,15 @@ void HuntState::OnUpdate(CCSBot *me)
|
|||||||
{
|
{
|
||||||
if (!me->IsRogue() && me->CanSeeLooseBomb())
|
if (!me->IsRogue() && me->CanSeeLooseBomb())
|
||||||
{
|
{
|
||||||
|
CNavArea *looseBombArea = TheCSBots()->GetLooseBombArea();
|
||||||
|
|
||||||
// if we are near the loose bomb and can see it, hide nearby and guard it
|
// if we are near the loose bomb and can see it, hide nearby and guard it
|
||||||
me->SetTask(CCSBot::GUARD_LOOSE_BOMB);
|
me->SetTask(CCSBot::GUARD_LOOSE_BOMB);
|
||||||
me->Hide(TheCSBots()->GetLooseBombArea());
|
me->Hide(looseBombArea);
|
||||||
me->GetChatter()->AnnouncePlan("GoingToGuardLooseBomb", TheCSBots()->GetLooseBombArea()->GetPlace());
|
|
||||||
|
if (looseBombArea)
|
||||||
|
me->GetChatter()->AnnouncePlan("GoingToGuardLooseBomb", looseBombArea->GetPlace());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (TheCSBots()->IsBombPlanted())
|
else if (TheCSBots()->IsBombPlanted())
|
||||||
|
Loading…
Reference in New Issue
Block a user