Skip to content

Commit

Permalink
Update mailbox.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosvf132 authored Sep 13, 2023
1 parent 0c7a52a commit cbf63a5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/items/containers/mailbox/mailbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ bool Mailbox::sendItem(Item* item) const {
return false;
}

if (item && item->getContainer() && item->getTile()) {
SpectatorHashSet spectators;
g_game().map.getSpectators(spectators, item->getTile()->getPosition(), false, true);
for (Creature* spectator : spectators) {
if (spectator && spectator->getPlayer()) {
spectator->getPlayer()->autoCloseContainers(item->getContainer());
}
}
}

Player* player = g_game().getPlayerByName(receiver, true);
std::string writer;
time_t date = time(0);
Expand Down

0 comments on commit cbf63a5

Please sign in to comment.