• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Housetile.cpp BUG

melegy

Devils
Joined
Dec 5, 2012
Messages
178
Reaction score
2
Location
Egypt
Hi, I've Problem in Housetile.cpp file that crashs down OT
Error
Assertion failed: destTile !=null, file ../housetile.cpp, line 61
This application has requested the runtime to terminate it in an unusual way.
Please contact eh application's support team for more information.
Aries.Xml 0.4.0
Already Have Source.
PLEASE HELP :D
 
Housetile.cpp file


Code:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "housetile.h"
#include "house.h"
#include "game.h"

extern Game g_game;

HouseTile::HouseTile(int x, int y, int z, House* _house) :
    Tile(x, y, z)
{
    house = _house;
    setFlag(TILESTATE_HOUSE);
}

HouseTile::~HouseTile()
{
    //
}

ReturnValue HouseTile::__queryAdd(int32_t index, const Thing* thing, uint32_t count,
    uint32_t flags) const
{
    if(const Creature* creature = thing->getCreature()){
        if(const Player* player = creature->getPlayer()){
            if(player->getAccessLevel() < ACCESS_HOUSE && !house->isInvited(player))
                return RET_PLAYERISNOTINVITED;
        }
    }

    return Tile::__queryAdd(index, thing, count, flags);
}

Cylinder* HouseTile::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
    uint32_t& flags)
{
    if(const Creature* creature = thing->getCreature()){
        if(const Player* player = creature->getPlayer()){
            if(!house->isInvited(player)){
                const Position& EntryPos = house->getEntryPosition();
                Tile* destTile = g_game.getTile(EntryPos.x, EntryPos.y, EntryPos.z);
                assert(destTile != NULL);

                index = -1;
                *destItem = NULL;
                return destTile;
            }
        }
    }

    return Tile::__queryDestination(index, thing, destItem, flags);
}
 
Code:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "housetile.h"
#include "house.h"
#include "game.h"

extern Game g_game;

HouseTile::HouseTile(int x, int y, int z, House* _house) :
  Tile(x, y, z)
{
  house = _house;
  setFlag(TILESTATE_HOUSE);
}

HouseTile::~HouseTile()
{
  //
}

ReturnValue HouseTile::__queryAdd(int32_t index, const Thing* thing, uint32_t count,
  uint32_t flags) const
{
  if(const Creature* creature = thing->getCreature()){
  if(const Player* player = creature->getPlayer()){
  if(player->getAccessLevel() < ACCESS_HOUSE && !house->isInvited(player))
  return RET_PLAYERISNOTINVITED;
  }
  }

  return Tile::__queryAdd(index, thing, count, flags);
}

Cylinder* HouseTile::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
  uint32_t& flags)
{
  if(const Creature* creature = thing->getCreature()){
  if(const Player* player = creature->getPlayer()){
  if(!house->isInvited(player)){
  const Position& EntryPos = house->getEntryPosition();
  Tile* destTile = g_game.getTile(EntryPos.x, EntryPos.y, EntryPos.z);
   
  if(!destTile)
  {
  destTile = g_game.getTile(player->getMasterPosition());
  if(!destTile)
  destTile = &(Tile::nullTile);
  }
  index = -1;
  *destItem = NULL;
  return destTile;
  }
  }
  }

  return Tile::__queryDestination(index, thing, destItem, flags);
}
 
Code:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "housetile.h"
#include "house.h"
#include "game.h"

extern Game g_game;

HouseTile::HouseTile(int x, int y, int z, House* _house) :
  Tile(x, y, z)
{
  house = _house;
  setFlag(TILESTATE_HOUSE);
}

HouseTile::~HouseTile()
{
  //
}

ReturnValue HouseTile::__queryAdd(int32_t index, const Thing* thing, uint32_t count,
  uint32_t flags) const
{
  if(const Creature* creature = thing->getCreature()){
  if(const Player* player = creature->getPlayer()){
  if(player->getAccessLevel() < ACCESS_HOUSE && !house->isInvited(player))
  return RET_PLAYERISNOTINVITED;
  }
  }

  return Tile::__queryAdd(index, thing, count, flags);
}

Cylinder* HouseTile::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
  uint32_t& flags)
{
  if(const Creature* creature = thing->getCreature()){
  if(const Player* player = creature->getPlayer()){
  if(!house->isInvited(player)){
  const Position& EntryPos = house->getEntryPosition();
  Tile* destTile = g_game.getTile(EntryPos.x, EntryPos.y, EntryPos.z);
  
  if(!destTile)
  {
  destTile = g_game.getTile(player->getMasterPosition());
  if(!destTile)
  destTile = &(Tile::nullTile);
  }
  index = -1;
  *destItem = NULL;
  return destTile;
  }
  }
  }

  return Tile::__queryDestination(index, thing, destItem, flags);
}

Is This Housetile.cpp with out that Error ?
 
Back
Top