Skip to content

Commit

Permalink
Prevent npc's jumping from ledges or running into dangerous tiles (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramza13 authored and kevingranade committed Dec 31, 2019
1 parent 521066c commit 48df630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/npcmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@ bool npc::can_move_to( const tripoint &p, bool no_bashing ) const
{
// Allow moving into any bashable spots, but penalize them during pathing
// Doors are not passable for hallucinations
return( rl_dist( pos(), p ) <= 1 &&
return( rl_dist( pos(), p ) <= 1 && g->m.has_floor( p ) && !g->is_dangerous_tile( p ) &&
( g->m.passable( p ) || ( can_open_door( p, !g->m.is_outside( pos() ) ) && !is_hallucination() ) ||
( !no_bashing && g->m.bash_rating( smash_ability(), p ) > 0 ) )
);
Expand Down

0 comments on commit 48df630

Please sign in to comment.