diff options
author | Jedzkie <jedzkie13@rocketmail.com> | 2017-04-23 11:12:36 +0800 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2017-04-24 12:59:02 +0200 |
commit | e6c0203a6da6930d9c4a2b762190cd0428e106ca (patch) | |
tree | b870735968c8898b614fca5339e12a375465a973 /src/map/script.c | |
parent | ab31b1129b0015559137509e0c3099386f1a69ee (diff) | |
download | hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.tar.gz hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.tar.bz2 hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.tar.xz hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.zip |
Removed hard coded values on @cashmount and setcashmount.
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 26 |
1 files changed, 17 insertions, 9 deletions
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; } |