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

When opening a container I don't have the option to go back. (inbox)

donabimbo

Member
Joined
May 1, 2023
Messages
27
Reaction score
9
GitHub
donabimbo
Greetings otland, I have a little problem with the inbox, it turns out that I just added the inbox to a Nekiro 8.60 since the sources did not contain the inbox.

I just added the inbox without any problems, getInbox() works for me, without problems, but here is a small error that is a bit annoying, when I open the depot chest, I can return without problems (turn back), but I can't go back inbox, for that I have to close it and reopen the depot locker.

I don't know if I missed a part of the inbox, or I have to modify something in container.ccp, I have no idea.

An example clip:
Recording 2023-05-10 at 13.48.43.gif
So I have added the inbox in player.ccp
Lua:
DepotChest* Player::getDepotChest(uint32_t depotId, bool autoCreate)
{
    auto it = depotChests.find(depotId);
    if (it != depotChests.end()) {
        return it->second;
    }

    if (!autoCreate) {
        return nullptr;
    }

    uint16_t depotItemId = getDepotBoxId(depotId);
    if (depotItemId == 0) {
        return nullptr;
    }

    it = depotChests.emplace(depotId, new DepotChest(depotItemId)).first;
    it->second->setMaxDepotItems(getMaxDepotItems());
    return it->second;
}

DepotLocker& Player::getDepotLocker()
{
    if (!depotLocker) {
        depotLocker = std::make_shared<DepotLocker>(ITEM_LOCKER);
        depotLocker->internalAddThing(inbox);
        DepotChest* depotChest = new DepotChest(ITEM_DEPOT);
        if (depotChest) {
            // adding in reverse to align them from first to last
            for (int16_t depotId = depotChest->capacity(); depotId >= 0; --depotId) {
                if (DepotChest* box = getDepotChest(depotId, true)) {
                    depotChest->internalAddThing(box);
                }
            }
            
            depotLocker->internalAddThing(depotChest);
        }
    }
    return *depotLocker;
}

I would appreciate any kind of help with this.
 
Greetings otland, I have a little problem with the inbox, it turns out that I just added the inbox to a Nekiro 8.60 since the sources did not contain the inbox.

I just added the inbox without any problems, getInbox() works for me, without problems, but here is a small error that is a bit annoying, when I open the depot chest, I can return without problems (turn back), but I can't go back inbox, for that I have to close it and reopen the depot locker.

I don't know if I missed a part of the inbox, or I have to modify something in container.ccp, I have no idea.

An example clip:
View attachment 75488
So I have added the inbox in player.ccp
Lua:
DepotChest* Player::getDepotChest(uint32_t depotId, bool autoCreate)
{
    auto it = depotChests.find(depotId);
    if (it != depotChests.end()) {
        return it->second;
    }

    if (!autoCreate) {
        return nullptr;
    }

    uint16_t depotItemId = getDepotBoxId(depotId);
    if (depotItemId == 0) {
        return nullptr;
    }

    it = depotChests.emplace(depotId, new DepotChest(depotItemId)).first;
    it->second->setMaxDepotItems(getMaxDepotItems());
    return it->second;
}

DepotLocker& Player::getDepotLocker()
{
    if (!depotLocker) {
        depotLocker = std::make_shared<DepotLocker>(ITEM_LOCKER);
        depotLocker->internalAddThing(inbox);
        DepotChest* depotChest = new DepotChest(ITEM_DEPOT);
        if (depotChest) {
            // adding in reverse to align them from first to last
            for (int16_t depotId = depotChest->capacity(); depotId >= 0; --depotId) {
                if (DepotChest* box = getDepotChest(depotId, true)) {
                    depotChest->internalAddThing(box);
                }
            }
           
            depotLocker->internalAddThing(depotChest);
        }
    }
    return *depotLocker;
}

I would appreciate any kind of help with this.
throw some bp on floor and open it, tell me if it appears the 'previous arrow'...
show your bool Container::hasParent() const in container.cpp
 
@pips
Here is the clip:
I just added the Reward Chest System, and the same thing happens too, I can't go back.
Recording 2023-05-10 at 19.07.47.gif

About bool Container::hasParent(), in that case apparently Nekiro 8.60 Downgrade does not bring that line.
I've been looking, and it's something about the BROWSE_FIELD, if I'm not mistaken.
 
@pips
Here is the clip:
I just added the Reward Chest System, and the same thing happens too, I can't go back.
View attachment 75491

About bool Container::hasParent(), in that case apparently Nekiro 8.60 Downgrade does not bring that line.
I've been looking, and it's something about the BROWSE_FIELD, if I'm not mistaken.

this function is the function you have to check; it is responsible for determining if the container have 'parent' (previous container) or not..
'browse field' doesn't have parent, this is the reason it appears on the function....
 
But in that case the depot chest does not happen that.
this function is the function you have to check; it is responsible for determining if the container have 'parent' (previous container) or not..
'browse field' doesn't have parent, this is the reason it appears on the function....

What would be the reason for the depot chest?
Recording 2023-05-11 at 00.02.41.gif
 
in inbox.cpp coment this:
C++:
/* Cylinder* getParent() const override; */

could you show me please

Lua:
// Copyright 2022 The Forgotten Server Authors. All rights reserved.
// Use of this source code is governed by the GPL-2.0 License that can be found in the LICENSE file.

#include "otpch.h"

#include "inbox.h"

#include "tools.h"

Inbox::Inbox(uint16_t type) : Container(type, 30, false, true) {}

ReturnValue Inbox::queryAdd(int32_t, const Thing& thing, uint32_t,
        uint32_t flags, Creature*) const
{
    if (!hasBitSet(FLAG_NOLIMIT, flags)) {
        return RETURNVALUE_CONTAINERNOTENOUGHROOM;
    }

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

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

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

    return RETURNVALUE_NOERROR;
}

void Inbox::postAddNotification(Thing* thing, const Cylinder* oldParent, int32_t index, cylinderlink_t)
{
    Cylinder* parent = getParent();
    if (parent) {
        parent->postAddNotification(thing, oldParent, index, LINK_PARENT);
    }
}

void Inbox::postRemoveNotification(Thing* thing, const Cylinder* newParent, int32_t index, cylinderlink_t)
{
    Cylinder* parent = getParent();
    if (parent) {
        parent->postRemoveNotification(thing, newParent, index, LINK_PARENT);
    }
}

Cylinder* Inbox::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
 
could you show me please
Rafaeru says to you, just search for this line.
search.
C++:
Cylinder* getParent() const override;
change to.
C++:
/* Cylinder* getParent() const override; */
That's all, it's already commenting, you know? So go ahead and search for all and comment them all /* */.
 
Back
Top