فهرست منبع

- status_damage will no longer fail when the target is not on a map AND the flag is 2 (charge rather than damage). Fixes SP-draining status changes ending suddenly when in-between maps.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7635 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 سال پیش
والد
کامیت
68dc3d890b
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 3 0
      Changelog-Trunk.txt
  2. 5 2
      src/map/status.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/07/12
+	* status_damage will no longer fail when the target is not on a map AND the
+	  flag is 2 (charge rather than damage). Fixes SP-draining status changes
+	  ending suddenly when in-between maps. [Skotlex]
 	* Fixed the IP value being apparently incorrectly casted before inserting
 	  into the loginlog table on "connect success" events. [Skotlex]
 	* Fixed Cart Termination's damage. [Skotlex]

+ 5 - 2
src/map/status.c

@@ -523,8 +523,11 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
 	
 	status = status_get_status_data(target);
 	
-	if (status == &dummy_status || !status->hp || !target->prev)
-		return 0; //Invalid targets: no damage, dead, not on a map.
+	if (status == &dummy_status || !status->hp)
+		return 0; //Invalid targets: no damage or dead
+
+	if (!target->prev && !(flag&2))
+		return 0; //Cannot damage a bl not on a map, except when "charging" hp/sp
 
 	sc = status_get_sc(target);