diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 2 | ||||
-rw-r--r-- | src/map/map.h | 2 | ||||
-rw-r--r-- | src/map/mercenary.c | 5 | ||||
-rw-r--r-- | src/map/mob.c | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 69534c9ed..674770e4a 100644 --- a/src/map/clif.c +++ b/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); } /*------------------------------------------ diff --git a/src/map/map.h b/src/map/map.h index bb4b0a94c..b880b8bf4 100644 --- a/src/map/map.h +++ b/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 }; diff --git a/src/map/mercenary.c b/src/map/mercenary.c index e324ec7ab..dc49f5e21 100644 --- a/src/map/mercenary.c +++ b/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; diff --git a/src/map/mob.c b/src/map/mob.c index 9829ad235..43ba8afb3 100644 --- a/src/map/mob.c +++ b/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]; |