diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index 4b10ebfba4..a4e4676282 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -871,7 +871,10 @@ // @reloadattendancedb 795: Attendance database has been reloaded. -//796-899 free +// NoRODEX Mapflag +796: You cannot use RODEX on this map. + +//797-899 free //------------------------------------ // More atcommands message diff --git a/src/map/clif.cpp b/src/map/clif.cpp index edac1d3ed1..ddba573eaf 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -15820,6 +15820,10 @@ void clif_Mail_refreshinbox(struct map_session_data *sd,enum mail_inbox_type typ /// 0ac0 .Q .16B (CZ_OPEN_MAILBOX2) /// 0ac1 .Q .16B (CZ_REQ_REFRESH_MAIL_LIST2) void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd){ + if( mail_invalid_operation( sd ) ){ + return; + } + #if PACKETVER < 20150513 struct mail_data* md = &sd->mail.inbox; @@ -16034,6 +16038,10 @@ void clif_parse_Mail_beginwrite( int fd, struct map_session_data *sd ){ safestrncpy(name, RFIFOCP(fd, 2), NAME_LENGTH); + if( mail_invalid_operation( sd ) ){ + return; + } + if( sd->state.storage_flag || sd->state.mail_writing || sd->trade_partner ){ clif_send_Mail_beginwrite_ack(sd, name, false); return; @@ -16072,6 +16080,10 @@ void clif_Mail_Receiver_Ack( struct map_session_data* sd, uint32 char_id, short void clif_parse_Mail_Receiver_Check(int fd, struct map_session_data *sd) { static char name[NAME_LENGTH]; + if( mail_invalid_operation( sd ) ){ + return; + } + safestrncpy(name, RFIFOCP(fd, 2), NAME_LENGTH); intif_mail_checkreceiver(sd, name); @@ -16270,6 +16282,10 @@ void clif_parse_Mail_setattach(int fd, struct map_session_data *sd){ if (sd->inventory_data[server_index(idx)] == nullptr) return; + if( mail_invalid_operation( sd ) ){ + return; + } + flag = mail_setitem(sd, idx, amount); if( flag == MAIL_ATTACH_EQUIPSWITCH ){ @@ -16352,6 +16368,10 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd){ return; } + if( mail_invalid_operation( sd ) ){ + return; + } + // Forged request without a begin writing packet? if( !sd->state.mail_writing ){ return; // Ignore it diff --git a/src/map/mail.cpp b/src/map/mail.cpp index 7b24830281..5f2f3e4d81 100644 --- a/src/map/mail.cpp +++ b/src/map/mail.cpp @@ -396,9 +396,14 @@ bool mail_invalid_operation(struct map_session_data *sd) ShowWarning("clif_parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name); return true; } -#endif +#else + if( map_getmapflag( sd->bl.m, MF_NORODEX ) ){ + clif_displaymessage( sd->fd, msg_txt( sd, 796 ) ); // You cannot use RODEX on this map. + return true; + } return false; +#endif } /** diff --git a/src/map/map.hpp b/src/map/map.hpp index 62ce03dac2..8d4d687839 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -610,6 +610,7 @@ enum e_mapflag : int16 { MF_PRIVATEAIRSHIP_DESTINATION, MF_SKILL_DURATION, MF_NOCASHSHOP, + MF_NORODEX, MF_MAX }; diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 9e80a7ee4c..17c4f9232f 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -479,6 +479,7 @@ export_constant(MF_PRIVATEAIRSHIP_DESTINATION); export_constant(MF_SKILL_DURATION); export_constant(MF_NOCASHSHOP); + export_constant(MF_NORODEX); /* setcell types */ export_constant(CELL_WALKABLE);