summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt4
-rw-r--r--src/map/skill.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/Changelog.txt b/Changelog.txt
index e04adfd81..2839c5d43 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,8 @@
Date Added
+
02/02
+ * Added checks to prevent some crashes in skill.c
+ [Full credit to shinomori] [SVN 1022: Ajarn]
* Removed nullpo check in skillnotok() -- otherwise it will display fail
messages for monster skills [celest]
* Added crash check for Ice Wall [celest]
@@ -25,6 +28,7 @@ Date Added
to char disconnection -- Fixes an odd crash with lazy mob AI [celest]
* Added at(@) command @autoloot, which turns autoloot on or off for the
player who uses it [Upa-Kun]
+
01/29
* Fixed Storage Bug with Named Stackable items. Thanks to Nimion [Lupus]
e.g. Arrows, Iron, Elemental stones, etc...
diff --git a/src/map/skill.c b/src/map/skill.c
index 2d3f07aac..674412332 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5819,7 +5819,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if(!goflag)
return 0;
ts->tick=tick;
-
+
switch(sg->unit_id){
case 0x83: /* サンクチュアリ */
{
@@ -5867,7 +5867,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if (sc_data[type].timer==-1)
status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0);
else if((unit2 = (struct skill_unit *)sc_data[type].val2) && unit2 != src){
- if(unit2->group && DIFF_TICK(sg->tick,unit2->group->tick) > 0)
+ if(unit2 && unit2->group && DIFF_TICK(sg->tick,unit2->group->tick) > 0)
status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0);
ts->tick-=sg->interval;
}
@@ -6020,7 +6020,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if (sc_data[type].timer==-1)
status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0);
else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){
- if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
+ if(unit2 && unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0);
ts->tick-=sg->interval;
}
@@ -6057,7 +6057,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
else if( (unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){
- if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
+ if(unit2 && unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
ts->tick-=sg->interval;
@@ -6077,7 +6077,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
else if((unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){
- if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
+ if(unit2 && unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 )
status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
ts->tick-=sg->interval;
@@ -6097,7 +6097,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick);
}
else if( (unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){
- if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) {
+ if(unit2 && unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) {
status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2,
(int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0);
skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick);