From e6c0203a6da6930d9c4a2b762190cd0428e106ca Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Sun, 23 Apr 2017 11:12:36 +0800 Subject: Removed hard coded values on @cashmount and setcashmount. --- src/map/script.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index c9c51afbc..a6d3ac852 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -21268,12 +21268,16 @@ BUILDIN(makerune) BUILDIN(hascashmount) { struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) return true; - if( sd->sc.data[SC_ALL_RIDING] ) - script_pushint(st,1); - else - script_pushint(st,0); + + if (sd->sc.data[SC_ALL_RIDING]) { + script_pushint(st, 1); + } else { + script_pushint(st, 0); + } + return true; } @@ -21287,18 +21291,22 @@ BUILDIN(hascashmount) BUILDIN(setcashmount) { struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) return true; + if (pc_hasmount(sd)) { clif->msgtable(sd, MSG_REINS_CANT_USE_MOUNTED); - script_pushint(st,0);//can't mount with one of these + script_pushint(st, 0); // Can't mount with one of these } else { - if (sd->sc.data[SC_ALL_RIDING]) + if (sd->sc.data[SC_ALL_RIDING]) { status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER); - else - sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, 25, INFINITE_DURATION); - script_pushint(st,1);//in both cases, return 1. + } else { + sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION); + } + script_pushint(st, 1); // In both cases, return 1. } + return true; } -- cgit v1.2.3-60-g2f50