Skip to content

Commit

Permalink
prevent units pushing into structures.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushutchings committed Oct 13, 2023
1 parent a758018 commit 2e7513d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rts/Sim/MoveTypes/GroundMoveType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3006,15 +3006,15 @@ void CGroundMoveType::UpdateOwnerPos(const float3& oldSpeedVector, const float3&
// relies on assumption that PFS will not search if start-sqr
// is blocked, so too fragile
//
if (!pathController.IgnoreTerrain(*owner->moveDef, owner->pos) && !owner->moveDef->TestMoveSquare(owner, owner->pos, owner->speed, true, false, true)) {
if (!pathController.IgnoreTerrain(*owner->moveDef, owner->pos) && !owner->moveDef->TestMoveSquare(owner, owner->pos, owner->speed, true, true, true)) {
bool updatePos = false;

for (unsigned int n = 1; n <= SQUARE_SIZE; n++) {
if (!updatePos && (updatePos = owner->moveDef->TestMoveSquare(owner, owner->pos + owner->rightdir * n, owner->speed, true, false, true))) {
if (!updatePos && (updatePos = owner->moveDef->TestMoveSquare(owner, owner->pos + owner->rightdir * n, owner->speed, true, true, true))) {
owner->Move(owner->pos + owner->rightdir * n, false);
break;
}
if (!updatePos && (updatePos = owner->moveDef->TestMoveSquare(owner, owner->pos - owner->rightdir * n, owner->speed, true, false, true))) {
if (!updatePos && (updatePos = owner->moveDef->TestMoveSquare(owner, owner->pos - owner->rightdir * n, owner->speed, true, true, true))) {
owner->Move(owner->pos - owner->rightdir * n, false);
break;
}
Expand Down

0 comments on commit 2e7513d

Please sign in to comment.