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

Feature Quiver [TFS 1.X + 0.X]

Hi, thanks for these codes. Quiver works very well but I've got problem with "onLookInShop" method. I added quiver to the NPC's offer and when I want to display its description server crashes. Can someone confirm if it's common bug or my other changes have impact on that quiver :D

Thanks in advance for help.
 
Last edited:
Hi, thanks for these codes. Quiver works very well but I've got problem with "onLook" method. I added quiver to the NPC's offer and when I want to display its description server crashes. Can someone confirm if it's common bug or my other changes have impact on that quiver :D

Thanks in advance for help.
Same issue, I ended by selling backpacks, bags, etc. with talkactions to avoid this but I can confirm the bug.
 
Further investigation revealed that something is messed up with any type of container using onLookInShop. It's not strictly related to the quiver (TFS 1.5) :(

I've made separate topic concerning this problem: TFS 1.X+ - Server crash - onLookInShop for container (https://otland.net/threads/server-crash-onlookinshop-for-container.287371/)

EDIT:
Found solution: TFS 1.X+ - TFS 1.5 8.6 strange bug when making "Look" in backpacks at NPC shop module (https://otland.net/threads/tfs-1-5-8-6-strange-bug-when-making-look-in-backpacks-at-npc-shop-module.284857/#post-2740564)
 
Last edited:
Anyone having a problem putting quiver inside quiver? and it works normally!

1705171889294.png

Would there be a way to block this?
 
Prevent any container
C++:
if (getName().find("quiver") != std::string::npos && item->getContainer()))
{
    return RET_NOTENOUGHROOM;
}
where do I put this player.cpp container.cpp?




It still doesn't work, it works 100%, I can't put another item just the quiver that goes inside it.
 
Last edited:
It looks like this, but it doesn't work!

Lua:
ReturnValue Container::queryAdd(int32_t index, const Thing& thing, uint32_t count,
        uint32_t flags, Creature* actor/* = nullptr*/) const
{
    bool childIsOwner = hasBitSet(FLAG_CHILDISOWNER, flags);
    if (childIsOwner) {
        //a child container is querying, since we are the top container (not carried by a player)
        //just return with no error.
        return RETURNVALUE_NOERROR;
    }

    if (!unlocked) {
        return RETURNVALUE_NOTPOSSIBLE;
    }

    const Item* item = thing.getItem();
    if (item == nullptr) {
        return RETURNVALUE_NOTPOSSIBLE;
    }

    if (!item->isPickupable()) {
        return RETURNVALUE_CANNOTPICKUP;
    }

    if (item == this) {
        return RETURNVALUE_THISISIMPOSSIBLE;
    }

    if (getName().find("Quiver") != std::string::npos && item->getContainer()))
{
        return RET_NOTENOUGHROOM;
}[/CÓDIGO]
ic
 
Has anyone solved the problem of using backpacks as quivers? what is the way to do this?
 
Back
Top