Jelajahi Sumber

- Fixed unit_attack_timer mismatch warnings (this was solved yesterday, but I forgot to apply the fix to trunk)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6306 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 tahun lalu
induk
melakukan
97f93f125a
3 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 0 2
      src/map/itemdb.h
  2. 0 1
      src/map/mob.c
  3. 5 2
      src/map/unit.c

+ 0 - 2
src/map/itemdb.h

@@ -38,7 +38,6 @@ struct item_data {
 	unsigned char *script;	//Default script for everything.
 	unsigned char *equip_script;	//Script executed once when equipping.
 	unsigned char *unequip_script;//Script executed once when unequipping.
-	
 	struct {
 		unsigned available : 1;
 		unsigned value_notdc : 1;
@@ -120,7 +119,6 @@ struct item_data* itemdb_exists(int nameid);
 int itemdb_group(int nameid);
 
 int itemdb_searchrandomid(int flags);
-int itemdb_searchrandomgroup(int groupid);
 
 #define itemdb_value_buy(n) itemdb_search(n)->value_buy
 #define itemdb_value_sell(n) itemdb_search(n)->value_sell

+ 0 - 1
src/map/mob.c

@@ -1520,7 +1520,6 @@ int mob_respawn(int tid, unsigned int tick, int id,int data )
 	md->last_thinktime = tick;
 	md->next_walktime = tick+rand()%50+5000;
 	md->last_linktime = tick;
-	unit_dataset(&md->bl);
 	map_addblock(&md->bl);
 	mob_heal(md,data*status_get_max_hp(&md->bl)/100);
 	clif_spawn(&md->bl);

+ 5 - 2
src/map/unit.c

@@ -197,6 +197,9 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
 			return 0;
 	}
 
+	if(tid == -1) //A directly invoked timer is from battle_stop_walking, therefore the rest is irrelevant.
+		return 0;
+		
 	if(ud->state.change_walk_target)
 		return unit_walktoxy_sub(bl);
 
@@ -1192,7 +1195,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
 		return 0;
 	if(ud->attacktimer != tid){
 		if(battle_config.error_log)
-			printf("unit_attack_timer %d != %d\n",ud->attacktimer,tid);
+			ShowError("unit_attack_timer %d != %d\n",ud->attacktimer,tid);
 		return 0;
 	}
 	BL_CAST( BL_PC , src, sd);
@@ -1344,7 +1347,7 @@ int unit_skillcastcancel(struct block_list *bl,int type)
 	else
 		ret=delete_timer( ud->skilltimer, skill_castend_id );
 	if(ret<0)
-		printf("delete timer error : skillid : %d\n",ret);
+		ShowError("delete timer error : skillid : %d\n",ret);
 	
 	if(bl->type==BL_MOB) ((TBL_MOB*)bl)->skillidx  = -1;