瀏覽代碼

Cleaning/fixing the previous commits a bit

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13775 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 16 年之前
父節點
當前提交
34def63ece
共有 6 個文件被更改,包括 10 次插入10 次删除
  1. 0 1
      src/map/battle.h
  2. 1 1
      src/map/clif.c
  3. 1 1
      src/map/mob.c
  4. 4 3
      src/map/pc.c
  5. 1 1
      src/map/script.c
  6. 3 3
      src/map/unit.c

+ 0 - 1
src/map/battle.h

@@ -58,7 +58,6 @@ enum {	// 
 	BF_WEAPONMASK=0x000f,
 	BF_RANGEMASK= 0x00f0,
 	BF_SKILLMASK= 0x0f00,
-	//0xf000 is used for marking if a zero damage is resulted from SafetyWall and the like. [Inkfish]
 };
 
 int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, int skill_id, int skill_lv, int damage, enum damage_lv dmg_lv, int ddelay);

+ 1 - 1
src/map/clif.c

@@ -3472,7 +3472,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
 		return;
 
 	ud = unit_bl2ud(bl);
-	len = ( ud && ud->walktimer != -1 ) ? clif_set_unit_walking(bl,ud,buf) : clif_set_unit_idle(bl,buf,false);
+	len = ( ud && ud->walktimer != INVALID_TIMER ) ? clif_set_unit_walking(bl,ud,buf) : clif_set_unit_idle(bl,buf,false);
 	clif_send(buf,len,&sd->bl,SELF);
 
 	if (vd->cloth_color)

+ 1 - 1
src/map/mob.c

@@ -2558,7 +2558,7 @@ int mob_class_change (struct mob_data *md, int class_)
 	unit_skillcastcancel(&md->bl, 0);
 	status_set_viewdata(&md->bl, class_);
 	clif_mob_class_change(md,class_);
-	status_calc_mob(md, 3);
+	status_calc_mob(md, 1);
 	md->ud.state.speed_changed = 1; //Speed change update.
 
 	if (battle_config.monster_class_change_recover) {

+ 4 - 3
src/map/pc.c

@@ -5206,9 +5206,10 @@ int pc_resethate(struct map_session_data* sd)
 int pc_skillatk_bonus(struct map_session_data *sd, int skill_num)
 {
 	int i, bonus = 0;
-	ARR_FIND(0, ARRAYLENGTH(sd->skillatk), i, !sd->skillatk[i].id || sd->skillatk[i].id == skill_num);
-	if( i < ARRAYLENGTH(sd->skillatk) && sd->skillatk[i].id )
-		bonus = sd->skillatk[i].val;
+
+	ARR_FIND(0, ARRAYLENGTH(sd->skillatk), i, sd->skillatk[i].id == skill_num);
+	if( i < ARRAYLENGTH(sd->skillatk) ) bonus = sd->skillatk[i].val;
+
 	if( sd->sc.data[SC_SKILLATKBONUS] )
 	{
 		if( sd->sc.data[SC_SKILLATKBONUS]->val1 && sd->sc.data[SC_SKILLATKBONUS]->val1 == skill_num )

+ 1 - 1
src/map/script.c

@@ -11162,7 +11162,7 @@ BUILDIN_FUNC(npcstop)
 	struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
 
 	if(nd) {
-		unit_stop_walking(&nd->bl,5);
+		unit_stop_walking(&nd->bl,1|4);
 	}
 
 	return 0;

+ 3 - 3
src/map/unit.c

@@ -159,7 +159,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data)
 	if (bl->x != x || bl->y != y || ud->walktimer != -1)
 		return 0; //map_moveblock has altered the object beyond what we expected (moved/warped it)
 
-	ud->walktimer = 1; //FIXME: why '1'? [ultramage]
+	ud->walktimer = -2; // arbitrary non-INVALID_TIMER value to make the clif code send walking packets
 	map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl);
 	ud->walktimer = INVALID_TIMER;
 	
@@ -508,7 +508,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
 
 	map_moveblock(bl, dst_x, dst_y, gettick());
 	
-	ud->walktimer = 1; //Enables clif_insight related packets to spawn character in moving animation.
+	ud->walktimer = -2; // arbitrary non-INVALID_TIMER value to make the clif code send walking packets
 	map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl);
 	ud->walktimer = INVALID_TIMER;
 		
@@ -814,7 +814,7 @@ int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int
 			}
 			else
 			{
-				unit_stop_walking(bl,6);
+				unit_stop_walking(bl,2|4);
 				if(ud->target)
 					add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
 			}