Comparing master...feature/quiver · rookgaard/3777
Contribute to rookgaard/3777 development by creating an account on GitHub.
github.com
Same issue, I ended by selling backpacks, bags, etc. with talkactions to avoid this but I can confirm the bug.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
Thanks in advance for help.
Prevent any containerAnyone having a problem putting quiver inside quiver? and it works normally!
View attachment 81370
Would there be a way to block this?
if (getName().find("quiver") != std::string::npos && item->getContainer()))
{
return RET_NOTENOUGHROOM;
}
where do I put this player.cpp container.cpp?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?
Gyazo Screen Video
gyazo.com
It still doesn't work, it works 100%, I can't put another item just the quiver that goes inside it.
Container::queryAdd
I don't understandLua:Container::queryAdd
Inside Container.cpp on function ReturnValue Container::queryAdd add the check that i provide.I don't understand
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