summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-05 23:06:28 -0300
committershennetsind <ind@henn.et>2013-07-05 23:06:28 -0300
commit144a9d0843dfe47e0b58c8857762f58ae70543c8 (patch)
tree9895c9f8fd9d6d2d0af34d83148adcd36dc777ea /src
parent04251494ebf61d3fba1a0b87cb80e90c6c9e32fd (diff)
downloadhercules-144a9d0843dfe47e0b58c8857762f58ae70543c8.tar.gz
hercules-144a9d0843dfe47e0b58c8857762f58ae70543c8.tar.bz2
hercules-144a9d0843dfe47e0b58c8857762f58ae70543c8.tar.xz
hercules-144a9d0843dfe47e0b58c8857762f58ae70543c8.zip
Fixed Bug #7307
http://hercules.ws/board/tracker/issue-7307-status-weapon-switch/ Special Thanks to kyeme, Beret. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/pc.c3
-rw-r--r--src/map/pc.h2
4 files changed, 12 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 3268128ac..cf952a3b9 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -226,7 +226,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
}
src = iMap->id2bl(dat->src_id);
-
+
if( src && target->m == src->m &&
(target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER) &&
check_distance_bl(src, target, dat->distance) ) //Check to see if you haven't teleported. [Skotlex]
@@ -246,6 +246,9 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
status_fix_damage(target, target, dat->damage, dat->delay);
iMap->freeblock_unlock();
}
+
+ if( src && src->type == BL_PC )
+ ((TBL_PC*)src)->delayed_damage--;
}
ers_free(delay_damage_ers, dat);
return 0;
@@ -287,6 +290,9 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
if (src->type != BL_PC && amotion > 1000)
amotion = 1000; //Aegis places a damage-delay cap of 1 sec to non player attacks. [Skotlex]
+ if( src->type == BL_PC )
+ ((TBL_PC*)src)->delayed_damage++;
+
iTimer->add_timer(tick+amotion, battle->delay_damage_sub, 0, (intptr_t)dat);
return 0;
diff --git a/src/map/clif.c b/src/map/clif.c
index c802929b4..b2461d8d5 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10664,7 +10664,7 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
else if ( pc_cant_act2(sd) || sd->state.prerefining )
return;
- if(!sd->status.inventory[index].identify) {
+ if(!sd->status.inventory[index].identify || sd->delayed_damage != 0) {
clif->equipitemack(sd,index,0,0); // fail
return;
}
diff --git a/src/map/pc.c b/src/map/pc.c
index e5a224e48..b14a02ed4 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1048,6 +1048,8 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->state.dialog = 0;
+ sd->delayed_damage = 0;
+
// Event Timers
for( i = 0; i < MAX_EVENTTIMER; i++ )
sd->eventtimer[i] = INVALID_TIMER;
@@ -4839,7 +4841,6 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if( hChSys.local && map[sd->bl.m].channel && idb_exists(map[sd->bl.m].channel->users, sd->status.char_id) ) {
clif->chsys_left(map[sd->bl.m].channel,sd);
}
-
}
if( m < 0 ) {
diff --git a/src/map/pc.h b/src/map/pc.h
index 7eedf813c..9f96486c9 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -502,6 +502,8 @@ struct map_session_data {
/* Made Possible Thanks to Yommy~! */
unsigned int cryptKey;
+ unsigned char delayed_damage;//ref. counter bugreport:7307 [Ind/Hercules]
+
// temporary debugging of bug #3504
const char* delunit_prevfile;
int delunit_prevline;