diff options
author | Asheraf <acheraf1998@gmail.com> | 2019-11-24 21:48:24 +0100 |
---|---|---|
committer | Asheraf <acheraf1998@gmail.com> | 2020-01-29 13:20:09 +0100 |
commit | e75ecacc2f3b2171a24df6abb089df4f3ecd9ebd (patch) | |
tree | 23d1b942aad72770b18aa71f3031f41fb407efda /src/map/pc.c | |
parent | c03722679a01e5f181c2138565e95a6b0981a124 (diff) | |
download | hercules-e75ecacc2f3b2171a24df6abb089df4f3ecd9ebd.tar.gz hercules-e75ecacc2f3b2171a24df6abb089df4f3ecd9ebd.tar.bz2 hercules-e75ecacc2f3b2171a24df6abb089df4f3ecd9ebd.tar.xz hercules-e75ecacc2f3b2171a24df6abb089df4f3ecd9ebd.zip |
Implement support for switching madogear type
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index c4f9d8be0..9d2816f3d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -9345,15 +9345,23 @@ static void pc_setridingpeco(struct map_session_data *sd, bool flag) * * @param sd Target player. * @param flag New state. + * @param mtype Type of the mado gear. **/ -static void pc_setmadogear(struct map_session_data *sd, bool flag) +static void pc_setmadogear(struct map_session_data *sd, bool flag, enum mado_type mtype) { nullpo_retv(sd); + Assert_retv(mtype >= MADO_ROBOT && mtype < MADO_MAX); + if (flag) { - if ((sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC) + if ((sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC) { pc->setoption(sd, sd->sc.option|OPTION_MADOGEAR); +#if PACKETVER_MAIN_NUM >= 20191120 || PACKETVER_RE_NUM >= 20191106 + sc_start(&sd->bl, &sd->bl, SC_MADOGEAR, 100, (int)mtype, INFINITE_DURATION); +#endif + } } else if (pc_ismadogear(sd)) { pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR); + // pc->setoption resets status effects when changing mado, no need to re do it here. } } |