Skip to content

Commit

Permalink
Allow zombies to smash (#37154)
Browse files Browse the repository at this point in the history
* fix global/local destination
  • Loading branch information
davidpwbrown authored and kevingranade committed Jan 17, 2020
1 parent 2809e4f commit 66807fe
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,6 @@ void monster::move()
if( !can_bash ) {
continue;
}

const int estimate = g->m.bash_rating( bash_estimate(), candidate );
if( estimate <= 0 ) {
continue;
Expand Down Expand Up @@ -923,14 +922,14 @@ void monster::move()
const bool can_open_doors = has_flag( MF_CAN_OPEN_DOORS );
// Finished logic section. By this point, we should have chosen a square to
// move to (moved = true).
const tripoint local_next_step = g->m.getlocal( next_step );
if( moved ) { // Actual effects of moving to the square we've chosen
const bool did_something =
( !pacified && attack_at( next_step ) ) ||
( !pacified && can_open_doors && g->m.open_door( next_step, !g->m.is_outside( pos() ) ) ) ||
( !pacified && bash_at( next_step ) ) ||
( !pacified && push_to( next_step, 0, 0 ) ) ||
move_to( g->m.getlocal( next_step ), false, get_stagger_adjust( pos(), destination,
g->m.getlocal( next_step ) ) );
( !pacified && attack_at( local_next_step ) ) ||
( !pacified && can_open_doors && g->m.open_door( local_next_step, !g->m.is_outside( pos() ) ) ) ||
( !pacified && bash_at( local_next_step ) ) ||
( !pacified && push_to( local_next_step, 0, 0 ) ) ||
move_to( local_next_step, false, get_stagger_adjust( pos(), destination, local_next_step ) );

if( !did_something ) {
moves -= 100; // If we don't do this, we'll get infinite loops.
Expand Down

0 comments on commit 66807fe

Please sign in to comment.