Skip to content

Commit d3d1e0f

Browse files
committed
rename to move_cost_multiplier
1 parent ef1fbbc commit d3d1e0f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/monmove.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,8 @@ static tripoint_bub_ms find_closest_stair( const tripoint_bub_ms &near_this,
17761776
return near_this;
17771777
}
17781778

1779-
bool monster::move_to( const tripoint_bub_ms &p, bool force, bool step_on_critter )
1779+
bool monster::move_to( const tripoint_bub_ms &p, bool force, bool step_on_critter,
1780+
const float move_cost_multiplier )
17801781
{
17811782
map &here = get_map();
17821783
const tripoint_bub_ms pos = pos_bub( here );
@@ -1844,7 +1845,8 @@ bool monster::move_to( const tripoint_bub_ms &p, bool force, bool step_on_critte
18441845
// is consistent even if the monster stumbles,
18451846
// and the same regardless of the distance measurement mode.
18461847
// Note: Keep this as float here or else it will cancel valid moves
1847-
const float cost = static_cast<float>( climbs() &&
1848+
const float cost = stagger_adjustment *
1849+
static_cast<float>( climbs() &&
18481850
here.has_flag( ter_furn_flag::TFLAG_NO_FLOOR, p ) ? calc_climb_cost( pos,
18491851
destination ) : calc_movecost( pos,
18501852
destination ) );

src/monster.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ class monster : public Creature
290290
*
291291
* @return true if movement successful, false otherwise
292292
*/
293-
bool move_to( const tripoint_bub_ms &p, bool force = false, bool step_on_critter = false );
293+
bool move_to( const tripoint_bub_ms &p, bool force = false, bool step_on_critter = false,
294+
float move_cost_multiplier = 1.0 );
294295

295296
/**
296297
* Attack any enemies at the given location.

0 commit comments

Comments
 (0)