Novalys
C++ Developer
Oh gosh, so you think this will take too long to get fixed?? It's complicated? or its that people still don't know where is the bug?
Oh gosh, so you think this will take too long to get fixed?? It's complicated? or its that people still don't know where is the bug?
else if(item->hasCharges())
{
int32_t newCharge = std::max(0, item->getItemCharge() - 1);
g_game.transformItem(item, item->getID(), newCharge);
}
This removes it completly: http://90.230.54.138/download/pathing.patch (You can apply using right-click->Merge Patch with Tortoise SVN)
However, there may be bugs I've not discovered yet, so use it at your own risk!
I've patched this to my TFS, and seems it works.
Till now no bugs or lags, but its night here, so we'll see tomorrow when server will handle around 60 players.
Another bug: !createguild crashes the server (missing #include "ioguild.h" or an 'extern' before 'IOGuild IOGuild;' ?)
bool Commands::createGuild(Creature* creature, const std::string& cmd, const std::string& param)
{
Player* player = creature->getPlayer();
if(player)
{
if(player->guildId == 0)
{
trimString((std::string&)param);
uint32_t minLength = g_config.getNumber(ConfigManager::MIN_GUILDNAME);
uint32_t maxLength = g_config.getNumber(ConfigManager::MAX_GUILDNAME);
if(param.length() >= minLength)
{
if(param.length() <= maxLength)
{
uint32_t guildId;
if(!IOGuild::getInstance()->getGuildIdByName(guildId, param))
{
uint32_t reqLevel = g_config.getNumber(ConfigManager::LEVEL_TO_FORM_GUILD);
if(player->level >= reqLevel)
{
if(player->isPremium())
{
char buffer[40 + maxLength];
sprintf(buffer, "You have formed the guild: %s!", param.c_str());
player->sendTextMessage(MSG_INFO_DESCR, buffer);
player->setGuildName(param);
IOGuild::getInstance()->createGuild(player);
return true;
}
else
player->sendCancelMessage(RET_YOUNEEDPREMIUMACCOUNT);
}
else
{
char buffer[75];
sprintf(buffer, "You have to be at least Level %i to form a guild.", reqLevel);
player->sendCancel(buffer);
}
}
else
player->sendCancel("There is already a guild with that name.");
}
else
player->sendCancel("That guild name is too long, please select a shorter name.");
}
else
player->sendCancel("That guild name is too short, please select a longer name.");
}
else
player->sendCancel("You are already in a guild.");
}
return false;
}