i'm using tfs 1.2
My problem is i receive the New mail has arrived in all towns, for example: i'm in thais depot tile, and someone send me a parcel to kazordoon, i receive the msg in Thais.
I found two functions that may be involved in my problem.
how could there be a separation in this system, only get msg if it's in the right town depot, maybe add another condition with isNearDepotBox() ? idk :/
My problem is i receive the New mail has arrived in all towns, for example: i'm in thais depot tile, and someone send me a parcel to kazordoon, i receive the msg in Thais.
I found two functions that may be involved in my problem.
C++:
void Player::onReceiveMail() const
{
if (isNearDepotBox()) {
sendTextMessage(MESSAGE_EVENT_ADVANCE, "New mail has arrived.");
}
}
bool Player::isNearDepotBox() const
{
const Position& pos = getPosition();
for (int32_t cx = -1; cx <= 1; ++cx) {
for (int32_t cy = -1; cy <= 1; ++cy) {
Tile* tile = g_game.map.getTile(pos.x + cx, pos.y + cy, pos.z);
if (!tile) {
continue;
}
if (tile->hasFlag(TILESTATE_DEPOT)) {
return true;
}
}
}
return false;
}
how could there be a separation in this system, only get msg if it's in the right town depot, maybe add another condition with isNearDepotBox() ? idk :/