summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-18 20:29:15 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-23 07:33:44 +0300
commit0c75c27cfb93cb9102747e1bf68c1474dc6eb4d0 (patch)
treed3d46e105547324e6123a39ba767ff5596755b1c
parentefeb386abc51baffa561f32d7d3b30868af767cd (diff)
downloadhercules-0c75c27cfb93cb9102747e1bf68c1474dc6eb4d0.tar.gz
hercules-0c75c27cfb93cb9102747e1bf68c1474dc6eb4d0.tar.bz2
hercules-0c75c27cfb93cb9102747e1bf68c1474dc6eb4d0.tar.xz
hercules-0c75c27cfb93cb9102747e1bf68c1474dc6eb4d0.zip
Split pc_addspiritball into two functions.
Move job mask related code into pc_addspiritball_sub.
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/pc.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index ee1fcd7da..6b947cf89 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -249,11 +249,18 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max)
memmove(sd->spirit_timer+i+1, sd->spirit_timer+i, (sd->spiritball-i)*sizeof(int));
sd->spirit_timer[i] = tid;
sd->spiritball++;
+ pc->addspiritball_sub(sd);
+
+ return 0;
+}
+
+int pc_addspiritball_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;
}
@@ -12363,6 +12370,7 @@ void pc_defaults(void) {
pc->delinvincibletimer = pc_delinvincibletimer;
pc->addspiritball = pc_addspiritball;
+ pc->addspiritball_sub = pc_addspiritball_sub;
pc->delspiritball = pc_delspiritball;
pc->addfame = pc_addfame;
pc->fame_rank = pc_fame_rank;
diff --git a/src/map/pc.h b/src/map/pc.h
index e699e5750..4422a0e1a 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -1040,6 +1040,7 @@ END_ZEROED_BLOCK; /* End */
void (*delinvincibletimer) (struct map_session_data* sd);
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 (*getmaxspiritball) (struct map_session_data *sd, int min);
void (*addfame) (struct map_session_data *sd, int ranktype, int count);