summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-03-22 18:26:29 -0300
committershennetsind <ind@henn.et>2014-03-22 18:26:29 -0300
commit17de8408fa79f286d65a4e35011c7524daf1202c (patch)
tree9188631e6f01353d0c59b0c7ba991f7d4d839581 /src
parent3b0597c7f7696265df322d4d858d9cb80c64954f (diff)
downloadhercules-17de8408fa79f286d65a4e35011c7524daf1202c.tar.gz
hercules-17de8408fa79f286d65a4e35011c7524daf1202c.tar.bz2
hercules-17de8408fa79f286d65a4e35011c7524daf1202c.tar.xz
hercules-17de8408fa79f286d65a4e35011c7524daf1202c.zip
Fixed Bug 8109
elemental's action could cause itself to be destroyed (e.g. due to target's reflect) and would thus cause sd->ed to be null, and would cause a crash when trying to access sd->ed->db, so moving the duration check to prior to elemental's action trigger. Special Thanks to OmegaRed. http://hercules.ws/board/tracker/issue-8109-mapserver-crash-skill-so-el-action Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/skill.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 4e64f39f2..08a8f69db 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9073,21 +9073,25 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case SO_EL_ACTION:
if( sd ) {
int duration = 3000;
- if( !sd->ed ) break;
+ if( !sd->ed )
+ break;
+
+ switch(sd->ed->db->class_){
+ case 2115:case 2124:
+ case 2118:case 2121:
+ duration = 6000;
+ break;
+ case 2116:case 2119:
+ case 2122:case 2125:
+ duration = 9000;
+ break;
+ }
+
sd->skill_id_old = skill_id;
elemental->action(sd->ed, bl, tick);
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- switch(sd->ed->db->class_){
- case 2115:case 2124:
- case 2118:case 2121:
- duration = 6000;
- break;
- case 2116:case 2119:
- case 2122:case 2125:
- duration = 9000;
- break;
- }
- skill->blockpc_start(sd, skill_id, duration);
+
+ skill->blockpc_start(sd, skill_id, duration);
}
break;