• 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!

TFS 1.X+ tile->hasFlag(TILESTATE_PROTECTIONZONE)

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,200
Solutions
2
Reaction score
149
I'm logging out of protection zone and its not printing anything, why?

in iologindata.cpp
loadPlayer

C++:
const Tile* tile = player->getTile();
if (tile && !tile->hasFlag(TILESTATE_PROTECTIONZONE)) {
    std::cout "testing " std::endl;
}

tested too:
C++:
if (!player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE)) {
 
Last edited by a moderator:
try remove tile from the if statement.
if you start getting that message all the time, or crash, then it fails to load the tile :o
 
"try remove tile from the if statement."
I can't, we will need declare "hasFlag", etc

another test:

C++:
const Tile* playerTile = player->getTile();
if (playerTile) {
  std::cout << playerTile << " Test 1" << std::endl;

Test 1 never print :eek:
 
You are logging out of protection zone and you expect loadPlayer function to load the player? Why? It saves the player, it loads when you login

If you meant when you log in, then you cannot get the player tile in this function, player object is not yet placed on the map, when this is executed, so the tile is nullptr.
 
You are logging out of protection zone and you expect loadPlayer function to load the player? Why? It saves the player, it loads when you login

If you meant when you log in, then you cannot get the player tile in this function, player object is not yet placed on the map, when this is executed, so the tile is nullptr.

I'm using the code above inside this function below:
C++:
bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)

I want check if player are logging in protection zone or not, what I'm doing wrong or missing?
 
Back
Top