summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-18 20:36:15 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-18 20:36:15 +0300
commit147b2309dc79242c19b225f9824d32f4f27c740c (patch)
tree32ce64b3608ab3a938fe064c8bfb8f35f12de0cb
parent7ff99743bad32919367da3542c5098e63fdec028 (diff)
downloadhercules-147b2309dc79242c19b225f9824d32f4f27c740c.tar.gz
hercules-147b2309dc79242c19b225f9824d32f4f27c740c.tar.bz2
hercules-147b2309dc79242c19b225f9824d32f4f27c740c.tar.xz
hercules-147b2309dc79242c19b225f9824d32f4f27c740c.zip
Split pc_delspiritball into two functions.
Move job mask related code into pc_delspiritball_sub.
-rw-r--r--src/map/pc.c19
-rw-r--r--src/map/pc.h1
2 files changed, 15 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 6b947cf89..1dac01109 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -294,14 +294,22 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type)
sd->spirit_timer[i] = INVALID_TIMER;
}
- if(!type) {
- if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD)
- clif->millenniumshield(&sd->bl,sd->spiritball);
- else
- clif->spiritball(&sd->bl);
+ if (!type) {
+ pc->delspiritball_sub(sd);
}
return 0;
}
+
+int pc_delspiritball_sub(struct map_session_data *sd)
+{
+ nullpo_ret(sd);
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD)
+ clif->millenniumshield(&sd->bl,sd->spiritball);
+ else
+ clif->spiritball(&sd->bl);
+ return 0;
+}
+
int pc_check_banding(struct block_list *bl, va_list ap)
{
int *c, *b_sd;
@@ -12372,6 +12380,7 @@ void pc_defaults(void) {
pc->addspiritball = pc_addspiritball;
pc->addspiritball_sub = pc_addspiritball_sub;
pc->delspiritball = pc_delspiritball;
+ pc->delspiritball_sub = pc_delspiritball_sub;
pc->addfame = pc_addfame;
pc->fame_rank = pc_fame_rank;
pc->famelist_type = pc_famelist_type;
diff --git a/src/map/pc.h b/src/map/pc.h
index 4422a0e1a..5fea4234b 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -1042,6 +1042,7 @@ END_ZEROED_BLOCK; /* End */
int (*addspiritball) (struct map_session_data *sd,int interval,int max);
int (*addspiritball_sub) (struct map_session_data *sd);
int (*delspiritball) (struct map_session_data *sd,int count,int type);
+ int (*delspiritball_sub) (struct map_session_data *sd);
int (*getmaxspiritball) (struct map_session_data *sd, int min);
void (*addfame) (struct map_session_data *sd, int ranktype, int count);
int (*fame_rank) (int char_id, int ranktype);