Ver Fonte

- Raised the amount of skills that can stack on a single cell before the "in-area/out-area" detection code breaks to 24 (from 8)
- Fixed a crash in clif_SkillInfoBlock if the passed player already disconnected.
- Added limiting drop rate to 100% from item-bonuses that depend on the mob's level so that "@autoloot 100" will catch them.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9270 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex há 18 anos atrás
pai
commit
943bff73bc
4 ficheiros alterados com 22 adições e 9 exclusões
  1. 7 0
      Changelog-Trunk.txt
  2. 3 1
      src/map/clif.c
  3. 1 0
      src/map/mob.c
  4. 11 8
      src/map/skill.c

+ 7 - 0
Changelog-Trunk.txt

@@ -3,6 +3,13 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2006/11/20
+	* Raised the amount of skills that can stack on a single cell before the
+	  "in-area/out-area" detection code breaks to 24 (from 8) [Skotlex]
+	* Fixed a crash in clif_SkillInfoBlock if the passed player already
+	  disconnected. [Skotlex]
+	* Added limiting drop rate to 100% from item-bonuses that depend on the
+	  mob's level so that "@autoloot 100" will catch them. [Skotlex]
 2006/11/19
 	* Removed security check since source level patch is applied. 
 	* Reverted select(), created prompt().

+ 3 - 1
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;
 }
 
 /*==========================================

+ 1 - 0
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

+ 11 - 8
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);
 	}