Skip to content

Commit f297298

Browse files
committed
deter civilians from walking on fire, let silacoids ignore it.
1 parent e5879af commit f297298

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Battlescape/Pathfinding.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ int Pathfinding::getTUCost(const Position &startPosition, int direction, Positio
433433
cost = (int)((double)cost * 1.5);
434434
}
435435
cost += wallcost;
436-
if (_unit->getFaction() == FACTION_HOSTILE &&
436+
if (_unit->getFaction() != FACTION_PLAYER &&
437+
_unit->getSpecab() < SPECAB_BURNFLOOR &&
437438
destinationTile->getFire() > 0)
438439
cost += 32; // try to find a better path, but don't exclude this path entirely.
439440

src/Battlescape/UnitWalkBState.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ void UnitWalkBState::think()
281281

282282
Position destination;
283283
int tu = _pf->getTUCost(_unit->getPosition(), dir, &destination, _unit, 0, false); // gets tu cost, but also gets the destination position.
284-
if (_unit->getFaction() == FACTION_HOSTILE &&
284+
if (_unit->getFaction() != FACTION_PLAYER &&
285+
_unit->getSpecab() < SPECAB_BURNFLOOR &&
285286
_parent->getSave()->getTile(destination)->getFire() > 0)
286287
{
287288
tu -= 32; // we artificially inflate the TU cost by 32 points in getTUCost under these conditions, so we have to deflate it here.

0 commit comments

Comments
 (0)