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

Check Item types

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
Some script onStartup to check what id and positions of these items without names, (item type)..

tfs 1.2
thanks



C++:
std::string Item::getNameDescription(const ItemType& it, const Item* item /*= nullptr*/, int32_t subType /*= -1*/, bool addArticle /*= true*/)
{
    if (item) {
        subType = item->getSubType();
    }

    std::ostringstream s;

    const std::string& name = (item ? item->getName() : it.name);
    if (!name.empty()) {
        if (it.stackable && subType > 1) {
            if (it.showCount) {
                s << subType << ' ';
            }

            s << (item ? item->getPluralName() : it.getPluralName());
        } else {
            if (addArticle) {
                const std::string& article = (item ? item->getArticle() : it.article);
                if (!article.empty()) {
                    s << article << ' ';
                }
            }

            s << name;
        }
    } else {
        s << "an item of type " << it.id;
    }
    return s.str();
}
 
Back
Top