ソースを参照

- Mercenary Dismiss packet and some corrections.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13127 54d463be-8e91-2dee-dedb-b68131a5f0ec
zephyrus 16 年 前
コミット
62c214e0f2
4 ファイル変更6 行追加5 行削除
  1. 2 0
      src/map/clif.c
  2. 1 1
      src/map/map.h
  3. 2 3
      src/map/mercenary.c
  4. 1 1
      src/map/mob.c

+ 2 - 0
src/map/clif.c

@@ -12469,6 +12469,8 @@ void clif_parse_mercenary_action(int fd, struct map_session_data* sd)
 	int option = RFIFOB(fd,2);
 	if( sd->md == NULL )
 		return;
+
+	if( option == 2 ) merc_delete(sd->md, 2);
 }
 
 /*------------------------------------------

+ 1 - 1
src/map/map.h

@@ -182,7 +182,7 @@ enum bl_type {
 };
 
 //For common mapforeach calls. Since pets cannot be affected, they aren't included here yet.
-#define BL_CHAR (BL_PC|BL_MOB|BL_HOM)
+#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER)
 
 enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP };
 

+ 2 - 3
src/map/mercenary.c

@@ -129,8 +129,7 @@ int merc_delete(struct mercenary_data *md, int reply)
 	struct map_session_data *sd = md->master;
 	md->mercenary.remain_life_time = 0;
 
-	if( md->contract_timer != INVALID_TIMER )
-		delete_timer(md->contract_timer, merc_contract_end);
+	merc_contract_stop(md);
 
 	if( !sd )
 		return unit_free(&md->bl, 1);
@@ -197,6 +196,7 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
 		map_addiddb(&md->bl);
 		status_calc_mercenary(md,1);
 		md->contract_timer = INVALID_TIMER;
+		merc_contract_init(md);
 	}
 	else
 		memcpy(&sd->md->mercenary, merc, sizeof(struct s_mercenary));
@@ -208,7 +208,6 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
 		clif_spawn(&md->bl);
 		clif_mercenary_info(sd);
 		clif_mercenary_skillblock(sd);
-		merc_contract_init(md);
 	}
 
 	return 1;

+ 1 - 1
src/map/mob.c

@@ -51,7 +51,7 @@
 #define MAX_MINCHASE 30	//Max minimum chase value to use for mobs.
 #define RUDE_ATTACKED_COUNT 2	//After how many rude-attacks should the skill be used?
 //Used to determine default enemy type of mobs (for use in eachinrange calls)
-#define DEFAULT_ENEMY_TYPE(md) (md->special_state.ai?BL_CHAR:BL_PC|BL_HOM)
+#define DEFAULT_ENEMY_TYPE(md) (md->special_state.ai?BL_CHAR:BL_PC|BL_HOM|BL_MER)
 
 //Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex]
 struct mob_db *mob_db_data[MAX_MOB_DB+1];