• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ new mail has arrived problem

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
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.
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 :/
 
Right click the depot lockers in RME and change their town. Im assuming you didnt and they are all linked together.
 
my all depot lockers in map have a town id according to the city, and the item sent go to right town, the problem is only the msg linked together.
 
Aren't the inbox inside depot has the same content no matter what town depot you use? I don't see any problem with that code unless you use some downgraded source which deleted inbox but you didn't specified it.
 
Back
Top