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

game.cpp stacking problem

chackie

New Member
Joined
Nov 1, 2009
Messages
87
Reaction score
0
Hello i have a stacking problem with potions.
Its says in game: you are using one of 87 great mana potions.. But i have 387 potions so it should say: You are using one of 387 great mana potion.
Same problem: http://otland.net/f16/stacking-bug-8-60-potions-help-107925/

Any clue how to do?
Need to fix my game.cpp?

MY GAME.CPP code:
Code:
void Game::showUseHotkeyMessage(Player* player, Item* item)
{
	const ItemType& it = Item::items[item->getID()];
	uint32_t itemCount = player->__getItemTypeCount(item->getID(), -1);

	std::stringstream ss;
	if(itemCount == 1){
		ss << "Using the last " << it.name << "...";
	}
	else{
		ss << "Using one of " << itemCount << " " << it.pluralName << "...";
	}

	player->sendTextMessage(MSG_INFO_DESCR, ss.str());
}
 
Try :::
Code:
void Game::showHotkeyUseMessage(Player* player, Item* item)
{
    const ItemType& it = Item::items[item->getID()];
    uint32_t count = player->__getItemTypeCount(item->getID(), -1);

    char buffer[40 + it.name.size()];
    if(count == 1)
        sprintf(buffer, "Using the last %s...", it.name.c_str());
    else
        sprintf(buffer, "Using one of %d %s...", count, it.pluralName.c_str());

    player->sendTextMessage(MSG_INFO_DESCR, buffer);
}
 
Back
Top