Skip to content

Commit

Permalink
fix for bots trying to mount in WSG and AV tunnels
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzdeveloper committed Aug 15, 2024
1 parent 780934a commit f87c87f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/strategy/actions/CheckMountStateAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ bool CheckMountStateAction::isUseful()
if (bot->isDead())
return false;

bool isOutdoor = bot->IsOutdoors();
if (!isOutdoor)
if (bot->HasUnitState(UNIT_STATE_IN_FLIGHT))
return false;

if (bot->HasUnitState(UNIT_STATE_IN_FLIGHT))
// checks both outdoors flag, and whether bot is clipping below floor slightly
// because that will cause bot to falsely indicate outdoors state and try
// mount indoors (seems to mostly be an issue in tunnels of WSG and AV)
if (!bot->IsOutdoors() || bot->GetPositionZ() < bot->GetMapWaterOrGroundLevel(
bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ()))
return false;

if (bot->InArena())
Expand Down

0 comments on commit f87c87f

Please sign in to comment.