Pārlūkot izejas kodu

* Fixed a problem that blockskill timer failed when there was more than one on a skill
- please test this, now Asura should be blocked 2 seconds after EVERY Snap

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

Playtester 16 gadi atpakaļ
vecāks
revīzija
4b66f607eb
3 mainītis faili ar 9 papildinājumiem un 5 dzēšanām
  1. 3 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/pc.h
  3. 5 4
      src/map/skill.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ 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.
 
+2009/03/27
+	* Fixed a problem that blockskill timer failed when there was more than one on a skill [Playtester]
+	- please test this, now Asura should be blocked 2 seconds after EVERY Snap
 2009/03/26
 	* Fixed Spirit of Assassin not reducing the aftercast delay of Sonic Blow [Playtester]
 	* Assumptio can neither be cast nor dispelled on monsters anymore [Playtester]

+ 1 - 1
src/map/pc.h

@@ -174,7 +174,7 @@ struct map_session_data {
 	short skillitem,skillitemlv;
 	short skillid_old,skilllv_old;
 	short skillid_dance,skilllv_dance;
-	char blockskill[MAX_SKILL];	// [celest]
+	unsigned char blockskill[MAX_SKILL];
 	int cloneskill_id;
 	int menuskill_id, menuskill_val;
 

+ 5 - 4
src/map/skill.c

@@ -10840,8 +10840,9 @@ int skill_blockpc_end(int tid, unsigned int tick, int id, intptr data)
 	struct map_session_data *sd = map_id2sd(id);
 	if (data <= 0 || data >= MAX_SKILL)
 		return 0;
-	if (sd) sd->blockskill[data] = 0;
-
+	if (!sd) return 0;
+	if (sd->blockskill[data] != (0x1|(tid&0xFE))) return 0;
+	sd->blockskill[data] = 0;
 	return 1;
 }
 
@@ -10858,8 +10859,8 @@ int skill_blockpc_start(struct map_session_data *sd, int skillid, int tick)
 		return -1;
 	}
 
-	sd->blockskill[skillid] = 1;
-	return add_timer(gettick()+tick,skill_blockpc_end,sd->bl.id,skillid);
+	sd->blockskill[skillid] = 0x1|(0xFE&add_timer(gettick()+tick,skill_blockpc_end,sd->bl.id,skillid));
+	return 0;
 }
 
 int skill_blockhomun_end(int tid, unsigned int tick, int id, intptr data)	//[orn]