Browse Source

- Fixed mob random walk interval being set to up to 6K seconds in some instances.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5621 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 năm trước cách đây
mục cha
commit
7571250c04
3 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 2 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/mob.c
  3. 2 2
      src/map/skill.c

+ 2 - 0
Changelog-Trunk.txt

@@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/03/15
+	* Fixed mob random walk interval being set to up to 6K seconds in some
+	  instances. [Skotlex]
 	* Added mapflag nodrop (prevents droping items to the ground). [Skotlex]
 	* Fixed mapflag notrade doing nothing. [Skotlex]
 	* Likely fixed Gravitation not hitting except for the last hit. [Skotlex]

+ 1 - 1
src/map/mob.c

@@ -1929,7 +1929,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
 	{
 		if (DIFF_TICK(md->next_walktime, tick) > 7000 &&
 			(md->walkpath.path_len == 0 || md->walkpath.path_pos >= md->walkpath.path_len))
-			md->next_walktime = tick + 3000 * rand() % 2000;
+			md->next_walktime = tick + 3000 + rand() % 2000;
 		// Random movement
 		if (mob_randomwalk(md,tick))
 			return 0;

+ 2 - 2
src/map/skill.c

@@ -779,10 +779,10 @@ int skillnotok(int skillid, struct map_session_data *sd)
 	if (i >= GD_SKILLBASE)
 		i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
 	
-	if (sd->blockskill[i] > 0)
+	if (i > MAX_SKILL || i < 0)
 		return 1;
 	
-	if (i > MAX_SKILL || i < 0)
+	if (sd->blockskill[i] > 0)
 		return 1;
 
 	if (battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond)