summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c19
-rw-r--r--src/map/pc.c20
-rw-r--r--src/map/pc.h4
3 files changed, 15 insertions, 28 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 93f7d260c..446f549d4 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8471,9 +8471,7 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
return;
pc_stop_attack(sd);
-
- if (sd->invincible_timer != -1)
- pc_delinvincibletimer(sd);
+ pc_delinvincibletimer(sd);
cmd = RFIFOW(fd,0);
x = RFIFOB(fd,packet_db[sd->packet_ver][cmd].pos[0]) * 4 +
@@ -8892,9 +8890,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
return;
}
}
- if (sd->invincible_timer != -1)
- pc_delinvincibletimer(sd);
+ pc_delinvincibletimer(sd);
sd->idletime = last_tick;
unit_attack(&sd->bl, target_id, action_type != 0);
break;
@@ -9313,8 +9310,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd) {
if (clif_trading(sd))
return;
- if (sd->invincible_timer != -1)
- pc_delinvincibletimer(sd);
+ pc_delinvincibletimer(sd);
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;
@@ -9789,8 +9785,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
return;
- if (sd->invincible_timer != -1)
- pc_delinvincibletimer(sd);
+ pc_delinvincibletimer(sd);
if(target_id<0 && -target_id == sd->bl.id) // for disguises [Valaris]
target_id = sd->bl.id;
@@ -9889,8 +9884,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
return;
- if (sd->invincible_timer != -1)
- pc_delinvincibletimer(sd);
+ pc_delinvincibletimer(sd);
if (sd->skillitem == skillnum) {
if (skilllv != sd->skillitemlv)
skilllv = sd->skillitemlv;
@@ -9953,8 +9947,7 @@ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd)
if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
return;
- if(sd->invincible_timer != -1)
- pc_delinvincibletimer(sd);
+ pc_delinvincibletimer(sd);
skill_castend_map(sd,RFIFOW(fd,2),(char*)RFIFOP(fd,4));
}
diff --git a/src/map/pc.c b/src/map/pc.c
index e20257085..f1dd19df4 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -131,15 +131,10 @@ int pc_setinvincibletimer(struct map_session_data *sd,int val) {
return 0;
}
-int pc_delinvincibletimer(struct map_session_data *sd) {
- nullpo_retr(0, sd);
-
- if(sd->invincible_timer != INVALID_TIMER) {
- delete_timer(sd->invincible_timer,pc_invincible_timer);
- sd->invincible_timer = INVALID_TIMER;
- skill_unit_move(&sd->bl,gettick(),1);
- }
- return 0;
+void pc_delinvincibletimer_sub(struct map_session_data *sd) {
+ delete_timer(sd->invincible_timer,pc_invincible_timer);
+ sd->invincible_timer = INVALID_TIMER;
+ skill_unit_move(&sd->bl,gettick(),1);
}
static int pc_spiritball_timer(int tid,unsigned int tick,int id,int data) {
@@ -606,6 +601,8 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
sd->followtimer = -1; // [MouseJstr]
sd->invincible_timer = -1;
+ sd->npc_timer_id = -1;
+ sd->pvp_timer = -1;
sd->canuseitem_tick = tick;
sd->cantalk_tick = tick;
@@ -650,11 +647,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
for(i = 0; i < MAX_EVENTTIMER; i++)
sd->eventtimer[i] = -1;
- sd->npc_timer_id = -1;
-
- // Moved PVP timer initialisation before set_pos
- sd->pvp_timer = -1;
-
for (i = 0; i < 3; i++)
sd->hate_mob[i] = -1;
diff --git a/src/map/pc.h b/src/map/pc.h
index 06d8198f9..f95a27085 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -279,7 +279,9 @@ extern struct skill_tree_entry skill_tree[MAX_PC_CLASS][MAX_SKILL_TREE];
int pc_read_gm_account(int fd);
int pc_setinvincibletimer(struct map_session_data *sd,int);
-int pc_delinvincibletimer(struct map_session_data *sd);
+void pc_delinvincibletimer_sub(struct map_session_data *sd);
+#define pc_delinvincibletimer(sd) if ((sd)->invincible_timer != INVALID_TIMER) pc_delinvincibletimer_sub(sd)
+
int pc_addspiritball(struct map_session_data *sd,int,int);
int pc_delspiritball(struct map_session_data *sd,int,int);
void pc_addfame(struct map_session_data *sd,int count);