From ab28897a624d29b96d13d0ba5e493e257555c0ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Feb 2019 21:57:34 -1100 Subject: [PATCH] Redo chg_str --- src/cc/rogue/misc.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/cc/rogue/misc.c b/src/cc/rogue/misc.c index 7db9d073a..8a4d1df94 100644 --- a/src/cc/rogue/misc.c +++ b/src/cc/rogue/misc.c @@ -349,17 +349,36 @@ void chg_str(int amt) { //auto jl777: strange compiler error - str_t comp; + uint32_t comp; if (amt == 0) return; - add_str(&pstats.s_str, amt); + //add_str(&pstats.s_str, amt); + pstats.s_str += amt; + if ( pstats.s_str < 3 ) + pstats.s_str = 3; + else if ( pstats.s_str > 31 ) + pstats.s_str = 31; comp = pstats.s_str; if (ISRING(LEFT, R_ADDSTR)) - add_str(&comp, -cur_ring[LEFT]->o_arm); + { + // add_str(&comp, -cur_ring[LEFT]->o_arm); + comp += -cur_ring[LEFT]->o_arm; + if ( comp < 3 ) + comp = 3; + else if ( comp > 31 ) + comp = 31; + } if (ISRING(RIGHT, R_ADDSTR)) - add_str(&comp, -cur_ring[RIGHT]->o_arm); - if (comp > max_stats.s_str) + { + //add_str(&comp, -cur_ring[RIGHT]->o_arm); + comp += -cur_ring[RIGHT]->o_arm; + if ( comp < 3 ) + comp = 3; + else if ( comp > 31 ) + comp = 31; + } + if ( comp > max_stats.s_str ) max_stats.s_str = comp; }