diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 4 | ||||
-rw-r--r-- | src/map/mob.c | 1 | ||||
-rw-r--r-- | src/map/skill.c | 19 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 28e3f0ecd..b268818ce 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4391,6 +4391,8 @@ int clif_skillinfoblock(struct map_session_data *sd) nullpo_retr(0, sd);
fd=sd->fd;
+ if (!fd) return 0;
+
WFIFOHEAD(fd, MAX_SKILL * 37 + 4);
WFIFOW(fd,0)=0x10f;
for ( i = c = 0; i < MAX_SKILL; i++){
@@ -4416,7 +4418,7 @@ int clif_skillinfoblock(struct map_session_data *sd) WFIFOW(fd,2)=len;
WFIFOSET(fd,len);
- return 0;
+ return 1;
}
/*==========================================
diff --git a/src/map/mob.c b/src/map/mob.c index 36af27b17..3e5338654 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2020,6 +2020,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) drop_rate = battle_config.item_drop_adddrop_min; else if (drop_rate > battle_config.item_drop_adddrop_max) drop_rate = battle_config.item_drop_adddrop_max; + if (drop_rate > 10000) drop_rate = 10000; } else //it's positive, then it goes as it is diff --git a/src/map/skill.c b/src/map/skill.c index a85737c6c..957f4f34a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2129,7 +2129,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds *------------------------------------------ */ static int skill_area_temp[8]; -static int skill_unit_temp[8]; /* For storing skill_unit ids as players move in/out of them. [Skotlex] */ +static int skill_unit_temp[24]; /* For storing skill_unit ids as players move in/out of them. [Skotlex] */ static int skill_unit_index=0; //Well, yeah... am too lazy to pass pointers around :X typedef int (*SkillFunc)(struct block_list *, struct block_list *, int, int, unsigned int, int); int skill_area_sub (struct block_list *bl, va_list ap) @@ -10135,15 +10135,16 @@ int skill_unit_move_sub (struct block_list *bl, va_list ap) if (flag&2) { //Clear skill ids we have stored in onout. int i; - for(i=0; i<8 && skill_unit_temp[i]!=skill_id; i++); - if (i<8) + for(i=0; i < (sizeof(skill_unit_temp)/sizeof(int)) && + skill_unit_temp[i]!=skill_id; i++); + if (i < (sizeof(skill_unit_temp)/sizeof(int))) skill_unit_temp[i] = 0; } } else { if (flag&2) { //Store this unit id. - if (skill_unit_index < 7) + if (skill_unit_index < (sizeof(skill_unit_temp)/sizeof(int))) skill_unit_temp[skill_unit_index++] = skill_id; else if (battle_config.error_log) ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n"); @@ -10164,8 +10165,9 @@ int skill_unit_move_sub (struct block_list *bl, va_list ap) if (flag&2 && result) { //Clear skill ids we have stored in onout. int i; - for(i=0; i<8 && skill_unit_temp[i]!=result; i++); - if (i<8) + for(i=0; i < (sizeof(skill_unit_temp)/sizeof(int)) && + skill_unit_temp[i]!=result; i++); + if (i < (sizeof(skill_unit_temp)/sizeof(int))) skill_unit_temp[i] = 0; } } @@ -10173,7 +10175,7 @@ int skill_unit_move_sub (struct block_list *bl, va_list ap) { result = skill_unit_onout(unit,target,tick); if (flag&2 && result) { //Store this unit id. - if (skill_unit_index < 7) + if (skill_unit_index < (sizeof(skill_unit_temp)/sizeof(int))) skill_unit_temp[skill_unit_index++] = result; else if (battle_config.error_log) ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n"); @@ -10219,7 +10221,8 @@ int skill_unit_move (struct block_list *bl, unsigned int tick, int flag) if (flag&2 && flag&1) { //Onplace, check any skill units you have left. int i; - for (i=0; i< 8 && skill_unit_temp[i]>0; i++) + for (i=0; i < (sizeof(skill_unit_temp)/sizeof(int)) && + skill_unit_temp[i]; i++) skill_unit_onleft(skill_unit_temp[i], bl, tick); } |