Depot* Player::getDepot(uint32_t depotId, bool autoCreateDepot)
{
DepotMap::iterator it = depots.find(depotId);
if(it != depots.end())
return it->second.first;
//create a new depot?
if(autoCreateDepot)
{
Item* locker = Item::CreateItem(ITEM_LOCKER);
if(Container* container = locker->getContainer())
{
if(Depot* depot = container->getDepot())
{
// container->__internalAddThing(Item::CreateItem(ITEM_DEPOT)); // REMOVE THIS LINE
addDepot(depot, depotId);
return depot;
}
}
g_game.freeThing(locker);
std::cout << "Failure: Creating a new depot with id: " <<...
Depot* Player::getDepot(uint32_t depotId, bool autoCreateDepot)
{
DepotMap::iterator it = depots.find(depotId);
if(it != depots.end())
return it->second.first;
//create a new depot?
if(autoCreateDepot)
{
Item* locker = Item::CreateItem(ITEM_LOCKER);
if(Container* container = locker->getContainer())
{
if(Depot* depot = container->getDepot())
{
// container->__internalAddThing(Item::CreateItem(ITEM_DEPOT)); // REMOVE THIS LINE
addDepot(depot, depotId);
return depot;
}
}
g_game.freeThing(locker);
std::cout << "Failure: Creating a new depot with id: " << depotId <<
", for player: " << getName() << std::endl;
}
return NULL;
}
I have this problem aswell. It gives server crashes if you open the one inside the depot.
player.cpp, remove
Code:Depot* Player::getDepot(uint32_t depotId, bool autoCreateDepot) { DepotMap::iterator it = depots.find(depotId); if(it != depots.end()) return it->second.first; //create a new depot? if(autoCreateDepot) { Item* locker = Item::CreateItem(ITEM_LOCKER); if(Container* container = locker->getContainer()) { if(Depot* depot = container->getDepot()) { [B][COLOR="red"]container->__internalAddThing(Item::CreateItem(ITEM_DEPOT));[/COLOR][/B] addDepot(depot, depotId); return depot; } } g_game.freeThing(locker); std::cout << "Failure: Creating a new depot with id: " << depotId << ", for player: " << getName() << std::endl; } return NULL; }