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

Solved PZ does not remove the "in a fight" staus

dominique120

Science & Reason
Senator
Premium User
Joined
Jun 16, 2013
Messages
3,881
Solutions
3
Reaction score
1,043
Location
Númenor
Why in my server, when someone enters a protection zone, they still have a "currently in a fight" indicator. Is there a way to get the PZ to remove the in a fight indicator to be able to log off immediately after entering the PZ?

TFS Version is 0.3.6, for 8.60
 
Last edited:
Well, I found the source code for the build of tfs that I am using here:

http://otland.net/threads/8-6-real-map-working-free.192571/

If someone would be so kind as to tell me what I must edit in here to get the results I want I would be most grateful. If someone would be even kinder and please help me and send me this source already compiled with this minor change, for Ubuntu x64, in GUI flavor, I would be forever grateful.
 
player.cpp

Replace
Code:
  if(getZone() == ZONE_PROTECTION)
     icons |= ICON_PROTECTIONZONE;

with this
Code:
  if(getZone() == ZONE_PROTECTION)
   {
   
     icons |= ICON_PROTECTIONZONE;
     
     // Don't show ICON_SWORDS if player is in protection zone.
     if(hasBitSet(ICON_SWORDS, icons))
       icons &= ~ICON_SWORDS;
   }
 
@Ninja I have done this but once the player is in the PZ the swords icon gets replaced but they still cant logout, says "you cant logout in a fight" even if they have the pz icon.
 
protocolgame.cpp

if(!player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) && player->hasCondition(CONDITION_INFIGHT))
 
Like this?

Code:
                if (!player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) && player->hasCondition(CONDITION_INFIGHT))
                {
                    player->sendCancelMessage(RET_YOUMAYNOTLOGOUTDURINGAFIGHT);
                    return false;
                }
 
Back
Top