From 2a2adc2b2d01adac655acdce31f3461a918ab2c9 Mon Sep 17 00:00:00 2001 From: Dpwb Date: Thu, 22 Aug 2019 14:40:27 +0200 Subject: [PATCH 1/3] reset moves on dismount --- src/player.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/player.cpp b/src/player.cpp index f0a05ff82f65d..ff1741e8146bb 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -11013,6 +11013,8 @@ void player::forced_dismount() bool mech = false; if( mounted_creature ) { auto mon = mounted_creature.get(); + // monster has been storing up moves while riding, reset them now so it dosnt zoom off. + mon->moves = 0; if( mon->has_flag( MF_RIDEABLE_MECH ) && !mon->type->mech_weapon.empty() ) { mech = true; remove_item( g->u.weapon ); @@ -11100,6 +11102,8 @@ void player::dismount() int ydiff = pos().y - temp_pt.y; remove_effect( effect_riding ); monster *critter = mounted_creature.get(); + // monster has been storing up moves while riding, reset them now so it dosnt zoom off. + critter->moves = 0; if( critter->has_flag( MF_RIDEABLE_MECH ) && !critter->type->mech_weapon.empty() ) { remove_item( g->u.weapon ); } From a8f1da382fea3c4fb8f12ac39f52d21e54c2dd7a Mon Sep 17 00:00:00 2001 From: Dpwb Date: Thu, 22 Aug 2019 16:10:28 +0200 Subject: [PATCH 2/3] stop regeneration of moves instead of resetting on dismount --- src/creature.cpp | 4 +++- src/player.cpp | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/creature.cpp b/src/creature.cpp index 97b130e4e3c30..c12bd8e3924fb 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -147,7 +147,9 @@ void Creature::process_turn() reset_stats(); // add an appropriate number of moves - moves += get_speed(); + if( !has_effect( effect_ridden ) ){ + moves += get_speed(); + } } // MF_DIGS or MF_CAN_DIG and diggable terrain diff --git a/src/player.cpp b/src/player.cpp index ff1741e8146bb..f0a05ff82f65d 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -11013,8 +11013,6 @@ void player::forced_dismount() bool mech = false; if( mounted_creature ) { auto mon = mounted_creature.get(); - // monster has been storing up moves while riding, reset them now so it dosnt zoom off. - mon->moves = 0; if( mon->has_flag( MF_RIDEABLE_MECH ) && !mon->type->mech_weapon.empty() ) { mech = true; remove_item( g->u.weapon ); @@ -11102,8 +11100,6 @@ void player::dismount() int ydiff = pos().y - temp_pt.y; remove_effect( effect_riding ); monster *critter = mounted_creature.get(); - // monster has been storing up moves while riding, reset them now so it dosnt zoom off. - critter->moves = 0; if( critter->has_flag( MF_RIDEABLE_MECH ) && !critter->type->mech_weapon.empty() ) { remove_item( g->u.weapon ); } From c5c9053820b188dacf39a57fdf09815e8f476f47 Mon Sep 17 00:00:00 2001 From: Dpwb Date: Thu, 22 Aug 2019 20:36:31 +0200 Subject: [PATCH 3/3] astyle --- src/creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creature.cpp b/src/creature.cpp index c12bd8e3924fb..7ce0060d95fe4 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -147,7 +147,7 @@ void Creature::process_turn() reset_stats(); // add an appropriate number of moves - if( !has_effect( effect_ridden ) ){ + if( !has_effect( effect_ridden ) ) { moves += get_speed(); } }