diff options
author | Haru <haru@dotalux.com> | 2020-02-09 23:10:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 23:10:59 +0100 |
commit | 1a0619fcedf573c7004489470f169e112fa1bb62 (patch) | |
tree | 47b502114376a2a8cd59604731703b93504fb4e5 /src/map/pc.c | |
parent | 66b624165ba2e7c868b38081230a61691be447df (diff) | |
parent | 7510db3f7b8990bbbcebcb1c3de8d20f8f27d011 (diff) | |
download | hercules-1a0619fcedf573c7004489470f169e112fa1bb62.tar.gz hercules-1a0619fcedf573c7004489470f169e112fa1bb62.tar.bz2 hercules-1a0619fcedf573c7004489470f169e112fa1bb62.tar.xz hercules-1a0619fcedf573c7004489470f169e112fa1bb62.zip |
Merge pull request #2586 from Asheraf/madostatueffect
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. } } |