From 0b7768837bed2aa521de5b9b76b2348943d7db20 Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Sun, 31 May 2020 10:53:09 +0800 Subject: Added configuration on allowing actions on player when dead. --- src/map/clif.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 7be5c6978..d52082e62 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -12283,7 +12283,7 @@ static void clif_parse_CreateChatRoom(int fd, struct map_session_data *sd) __att /// 1 = public static void clif_parse_CreateChatRoom(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_CHAT) == 0) || pc_isvending(sd)) return; int len = (int)RFIFOW(fd, 2) - 15; @@ -12331,7 +12331,7 @@ static void clif_parse_ChatAddMember(int fd, struct map_session_data *sd) __attr /// 00d9 .L .8B static void clif_parse_ChatAddMember(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_CHAT) == 0) || pc_isvending(sd)) return; int chatid = RFIFOL(fd,2); @@ -12348,7 +12348,7 @@ static void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data *sd) /// 1 = public static void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_CHAT) == 0) || pc_isvending(sd)) return; int len = (int)RFIFOW(fd, 2) - 15; @@ -12383,7 +12383,7 @@ static void clif_parse_ChangeChatOwner(int fd, struct map_session_data *sd) __at /// 1 = normal static void clif_parse_ChangeChatOwner(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_CHAT) == 0) || pc_isvending(sd)) return; chat->change_owner(sd, RFIFOP(fd,6)); // non null terminated @@ -12394,7 +12394,7 @@ static void clif_parse_KickFromChat(int fd, struct map_session_data *sd) __attri /// 00e2 .24B static void clif_parse_KickFromChat(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_CHAT) == 0) || pc_isvending(sd)) return; chat->kick(sd, RFIFOP(fd,2)); // non null terminated @@ -12405,7 +12405,7 @@ static void clif_parse_ChatLeave(int fd, struct map_session_data *sd) __attribut /// 00e3 static void clif_parse_ChatLeave(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_CHAT) == 0) || pc_isvending(sd)) return; chat->leave(sd, false); @@ -12432,7 +12432,7 @@ static void clif_parse_TradeRequest(int fd, struct map_session_data *sd) __attri /// 00e4 .L static void clif_parse_TradeRequest(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_TRADE) == 0) || pc_isvending(sd)) return; struct map_session_data *t_sd = map->id2sd(RFIFOL(fd, 2)); @@ -12462,7 +12462,7 @@ static void clif_parse_TradeAck(int fd, struct map_session_data *sd) __attribute /// 4 = rejected static void clif_parse_TradeAck(int fd, struct map_session_data *sd) { - if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_TRADE) == 0) || pc_isvending(sd)) return; trade->ack(sd,RFIFOB(fd,2)); @@ -12473,7 +12473,7 @@ static void clif_parse_TradeAddItem(int fd, struct map_session_data *sd) __attri /// 00e8 .W .L static void clif_parse_TradeAddItem(int fd, struct map_session_data *sd) { - if (!sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) + if (sd->state.trading == 0 || (pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_TRADE) == 0) || pc_isvending(sd)) return; short index = RFIFOW(fd,2); @@ -12490,8 +12490,9 @@ static void clif_parse_TradeOk(int fd, struct map_session_data *sd) __attribute_ /// 00eb static void clif_parse_TradeOk(int fd, struct map_session_data *sd) { - if (pc_isdead(sd) || pc_isvending(sd)) + if ((pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_TRADE) == 0) || pc_isvending(sd)) return; + trade->ok(sd); } @@ -12500,7 +12501,7 @@ static void clif_parse_TradeCancel(int fd, struct map_session_data *sd) __attrib /// 00ed static void clif_parse_TradeCancel(int fd, struct map_session_data *sd) { - if (pc_isdead(sd) || pc_isvending(sd)) + if ((pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_TRADE) == 0) || pc_isvending(sd)) return; trade->cancel(sd); @@ -12511,7 +12512,7 @@ static void clif_parse_TradeCommit(int fd, struct map_session_data *sd) __attrib /// 00ef static void clif_parse_TradeCommit(int fd, struct map_session_data *sd) { - if (pc_isdead(sd) || pc_isvending(sd)) + if ((pc_isdead(sd) && (battle_config.allowed_actions_when_dead & PCALLOWACTION_TRADE) == 0) || pc_isvending(sd)) return; trade->commit(sd); -- cgit v1.2.3-60-g2f50