From deb5325f20bd8572942cbcb6649daf09c5cb2e83 Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 20 Dec 2017 22:13:09 +0900 Subject: [PATCH] =?utf8?q?#37287=20#37353=20(2.2.0.89)=20=E5=9E=8B?= =?utf8?q?=E3=81=AE=E7=BD=AE=E6=8F=9B=E3=82=92=E7=B6=99=E7=B6=9A=E4=B8=AD?= =?utf8?q?=E3=80=82=20/=20Ongoing=20type=20replacement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/util.c | 9 ++++++--- src/xtra2.c | 26 ++++++++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/util.c b/src/util.c index 72e20728b..5b65235d1 100644 --- a/src/util.c +++ b/src/util.c @@ -3805,10 +3805,11 @@ bool get_com(cptr prompt, char *command, bool z_escape) */ QUANTITY get_quantity(cptr prompt, QUANTITY max) { - bool res; + bool res, result; QUANTITY amt; char tmp[80]; char buf[80]; + COMMAND_CODE code; /* Use "command_arg" */ @@ -3830,7 +3831,9 @@ QUANTITY get_quantity(cptr prompt, QUANTITY max) #ifdef ALLOW_REPEAT /* TNB */ /* Get the item index */ - if ((max != 1) && repeat_pull(&amt)) + result = repeat_pull(&code); + amt = (QUANTITY)code; + if ((max != 1) && result) { /* Enforce the maximum */ if (amt > max) amt = max; @@ -3892,7 +3895,7 @@ QUANTITY get_quantity(cptr prompt, QUANTITY max) #ifdef ALLOW_REPEAT /* TNB */ - if (amt) repeat_push(amt); + if (amt) repeat_push((COMMAND_CODE)amt); #endif /* ALLOW_REPEAT -- TNB */ diff --git a/src/xtra2.c b/src/xtra2.c index 5c3b67859..c0332fe1b 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -4091,6 +4091,7 @@ bool get_aim_dir(DIRECTION *dp) DIRECTION dir; char command; cptr p; + COMMAND_CODE code; /* Initialize */ (*dp) = 0; @@ -4103,17 +4104,18 @@ bool get_aim_dir(DIRECTION *dp) #ifdef ALLOW_REPEAT /* TNB */ - if (repeat_pull(dp)) + if (repeat_pull(&code)) { /* Confusion? */ /* Verify */ - if (!(*dp == 5 && !target_okay())) + if (!(code == 5 && !target_okay())) { /* return (TRUE); */ - dir = *dp; + dir = (DIRECTION)code; } } + *dp = (DIRECTION)code; #endif /* ALLOW_REPEAT -- TNB */ @@ -4208,7 +4210,7 @@ bool get_aim_dir(DIRECTION *dp) #ifdef ALLOW_REPEAT /* TNB */ /* repeat_push(dir); */ - repeat_push(command_dir); + repeat_push((COMMAND_CODE)command_dir); #endif /* ALLOW_REPEAT -- TNB */ @@ -4238,6 +4240,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) { DIRECTION dir; cptr prompt; + COMMAND_CODE code; /* Initialize */ (*dp) = 0; @@ -4247,11 +4250,12 @@ bool get_rep_dir(DIRECTION *dp, bool under) #ifdef ALLOW_REPEAT /* TNB */ - if (repeat_pull(dp)) + if (repeat_pull(&code)) { - dir = *dp; + dir = (DIRECTION)code; /* return (TRUE); */ } + *dp = (DIRECTION)code; #endif /* ALLOW_REPEAT -- TNB */ @@ -4363,7 +4367,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) #ifdef ALLOW_REPEAT /* TNB */ /* repeat_push(dir); */ - repeat_push(command_dir); + repeat_push((COMMAND_CODE)command_dir); #endif /* ALLOW_REPEAT -- TNB */ @@ -4375,6 +4379,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) bool get_rep_dir2(DIRECTION *dp) { DIRECTION dir; + COMMAND_CODE code; /* Initialize */ (*dp) = 0; @@ -4384,11 +4389,12 @@ bool get_rep_dir2(DIRECTION *dp) #ifdef ALLOW_REPEAT /* TNB */ - if (repeat_pull(dp)) + if (repeat_pull(&code)) { - dir = *dp; + dir = (DIRECTION)code; /* return (TRUE); */ } + *dp = (DIRECTION)code; #endif /* ALLOW_REPEAT -- TNB */ @@ -4440,7 +4446,7 @@ bool get_rep_dir2(DIRECTION *dp) #ifdef ALLOW_REPEAT /* TNB */ /* repeat_push(dir); */ - repeat_push(command_dir); + repeat_push((COMMAND_CODE)command_dir); #endif /* ALLOW_REPEAT -- TNB */ -- 2.11.0