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

Compiling My TFS 8.6 hotkey message bug

Shynzo

Banned User
Joined
Jun 15, 2008
Messages
142
Reaction score
0
Location
Brazil
My Messages hotkeys are buggy ... for example ... I have 1000 and the sudden death runes menssagem says I have 30/40

How do I fix?

PHP:
void Game::showHotkeyUseMessage(Player* player, Item* item)
{
	int32_t subType = -1;
	if(item->hasSubType() && !item->hasCharges())
		subType = item->getSubType();

	const ItemType& it = Item::items[item->getID()];
	uint32_t count = player->__getItemTypeCount(item->getID(), subType, false);

	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);
}

Please help
:)
 
Code:
void Game::showHotkeyUseMessage(Player* player, Item* item)
{
    const ItemType& it = Item::items[item->getID()];
    uint32_t count = player->__getItemTypeCount(item->getID(), item->isFluidContainer() ? item->getFluidType() : -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