Преглед изворни кода

Added missing restrictions when writing a mail (#4772)

Daegaladh пре 5 година
родитељ
комит
3424928fa1
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 3 0
      src/map/pc.cpp
  2. 1 1
      src/map/unit.cpp

+ 3 - 0
src/map/pc.cpp

@@ -5366,6 +5366,9 @@ int pc_useitem(struct map_session_data *sd,int n)
 
 	nullpo_ret(sd);
 
+	if (sd->state.mail_writing)
+		return 0;
+
 	if (sd->npc_id) {
 		if (sd->progressbar.npc_id) {
 			clif_progressbar_abort(sd);

+ 1 - 1
src/map/unit.cpp

@@ -1384,7 +1384,7 @@ int unit_can_move(struct block_list *bl) {
 	if (DIFF_TICK(ud->canmove_tick, gettick()) > 0)
 		return 0;
 
-	if ((sd && (pc_issit(sd) || sd->state.vending || sd->state.buyingstore || (sd->state.block_action & PCBLOCK_MOVE))) || ud->state.blockedmove)
+	if ((sd && (pc_issit(sd) || sd->state.vending || sd->state.buyingstore || (sd->state.block_action & PCBLOCK_MOVE) || sd->state.mail_writing)) || ud->state.blockedmove)
 		return 0; // Can't move
 
 	// Status changes that block movement