From d05e09ad88d4aff34d0672961cb29eb77adec06d Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 11 Mar 2024 01:19:40 +0100 Subject: [PATCH] Cleaned up SOA_EXORCISM_OF_MALICIOUS_SOUL --- src/map/skill.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 1594e11656..bfcfafcf26 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -8678,12 +8678,18 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui if (skill_id == MH_THE_ONE_FIGHTER_RISES) { hom_addspiritball(hd, MAX_SPIRITBALL); } - if (skill_id == SOA_EXORCISM_OF_MALICIOUS_SOUL ) { - if (sd) { - // Remove old souls if any exist. - sd->soulball_old = sd->soulball; - pc_delsoulball(sd, sd->soulball, 0); - } + + // TODO: refactor the ifs above into the switch below + + switch( skill_id ){ + case SOA_EXORCISM_OF_MALICIOUS_SOUL: + if( sd != nullptr ){ + // Remove old souls if any exist. + sd->soulball_old = sd->soulball; + pc_delsoulball( sd, sd->soulball, 0 ); + } + break; + } if (skill_id == SOA_TALISMAN_OF_WHITE_TIGER ) { if (sc && (sc->getSCE(SC_T_FIRST_GOD) && !sc->getSCE(SC_T_SECOND_GOD) && !sc->getSCE(SC_T_FIFTH_GOD))){