Yellow tanks give up if blocked

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-16 14:28:11 -07:00
parent 2eb7c4cff9
commit 408e4cd9f6
2 changed files with 6 additions and 6 deletions

View File

@ -966,6 +966,11 @@ export class Level {
return;
let all_blocked = true;
for (let [i, direction] of direction_preference.entries()) {
if (direction === null) {
// This actor is giving up! Alas.
actor.decision = direction;
break;
}
if (typeof direction === 'function') {
// Lazy direction calculation (used for walkers)
direction = direction();

View File

@ -1861,12 +1861,7 @@ const TILE_TYPES = {
},
movement_speed: 4,
decide_movement(me, level) {
if (level.yellow_tank_decision) {
return [level.yellow_tank_decision];
}
else {
return null;
}
return [level.yellow_tank_decision, null];
}
},
blob: {