Pārlūkot izejas kodu

- Fixed the mob state not being set to Berserk/Angry correctly after the mob reaches the target's location.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7040 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 gadi atpakaļ
vecāks
revīzija
a5ae39dd6c
2 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 2 0
      Changelog-Trunk.txt
  2. 4 0
      src/map/mob.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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/06/07
+	* Fixed the mob state not being set to Berserk/Angry correctly after the
+	  mob reaches the target's location. [Skotlex]
 	* Added config setting mob_npc_warp, when set to yes, enables mobs to be
 	  warped between maps when stepping on a npc-warp. [Skotlex]
 	* Added monster_ai setting &64, when enabled makes a mob run to any nearby

+ 4 - 0
src/map/mob.c

@@ -1196,7 +1196,11 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
 		{	//Attempt to attack.
 			//At this point we know the target is attackable, we just gotta check if the range matches.
 			if (md->ud.target == tbl->id && md->ud.attacktimer != -1)
+			{
+				if (md->state.skillstate!=(md->state.aggressive?MSS_ANGRY:MSS_BERSERK))
+					md->state.skillstate = md->state.aggressive?MSS_ANGRY:MSS_BERSERK;	//Correct the state.
 				return 0; //Already locked.
+			}
 			
 			if (!battle_check_range (&md->bl, tbl, md->status.rhw.range))
 			{	//Out of range...