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

C++ [1.5 Nekiro 8.00]Depot Chest not saving or clone item

Error 502

Intermediate OT User
Joined
Sep 25, 2022
Messages
238
Solutions
8
Reaction score
145
Location
Chile
Nekiro 1.5 downgrade 8.00

locker ✅ work
Depot Chest ❌ bug
image.png




Depot Chest not saving

1.- Login to game
2.- Put ITEM of your INVENTARY in Depot Chest
3 .- Relog
4.- no save item in depot chest
bandicam 2023-01-09 14-43-31-914_2.gif
Depot Chest clone item

1.- Login to game
2.- Put ITEM OF LOCKER in Depot Chest
4.- relog
5.- open depot chest
6.- put previous item on floot
7.- relog
8.- clone done, put item on floot
9.- relog
10.- clone done , put item on floot
bandicam 2023-01-09 14-43-31-914_1.gif
No error in console


XML:
    <item fromid="2589" toid="2592" article="a" name="locker">
        <attribute key="type" value="depot" />
        <attribute key="containerSize" value="3" />
    </item>

 
<item id="2594" article="a" name="depot chest">
 
        <attribute key="containerSize" value="30" />
    </item>

src defaul

iologindata.cpp



container.cpp




SQL
SQL:
CREATE TABLE `player_depotitems` (
  `player_id` int(11) NOT NULL,
  `sid` int(11) NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
  `pid` int(11) NOT NULL DEFAULT 0,
  `itemtype` smallint(5) UNSIGNED NOT NULL,
  `count` smallint(6) NOT NULL DEFAULT 0,
  `attributes` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;




CREATE TABLE `player_depotlockeritems` (
  `player_id` int(11) NOT NULL,
  `sid` int(11) NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
  `pid` int(11) NOT NULL DEFAULT 0,
  `itemtype` smallint(6) NOT NULL,
  `count` smallint(6) NOT NULL DEFAULT 0,
  `attributes` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;




what does it affect?

-player can't save yours items
-player can clone
-script with local depot = winner:getDepotChest(winner:getTown():getId(), true)
they don't work properly
 
Last edited:
can confirm, it only happens when you relog after adding new or moving old items inside 'depot chest'.
1. add new items + relog = item gone
2. move old items + relog = item dupe
 
I've solved this exactly today

so
in depotchest.h
commit this
Lua:
Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }
so it should look like this
Code:
/*Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }*/
in depotchest.cpp commit this
Diff:
Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
it should look like this
Code:
/*Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
*/
in item.h below
Code:
    bool isRune() const {
            return items[id].isRune();
        }
add
Code:
void setStoreItem(bool storeItem) {
            setIntAttr(ITEM_ATTRIBUTE_STOREITEM, static_cast<int64_t>(storeItem));
        }
        bool isStoreItem() const {
            if (hasAttribute(ITEM_ATTRIBUTE_STOREITEM)) {
                return getIntAttr(ITEM_ATTRIBUTE_STOREITEM) == 1;
            }
            return items[id].storeItem;
        }
and in container.cpp un-commit this
Code:
    // store items can be only moved into depot chest or store inbox
    /*if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }*/

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    /*if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
    */
so it should look like this
Code:
    // store items can be only moved into depot chest or store inbox
    if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
tested and work! rep ++ please and good luck
with this the items will be stored properly and this might fix the clonning issue too
 
I've solved this exactly today

so
in depotchest.h
commit this
Lua:
Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }
so it should look like this
Code:
/*Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }*/
in depotchest.cpp commit this
Diff:
Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
it should look like this
Code:
/*Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
*/
in item.h below
Code:
    bool isRune() const {
            return items[id].isRune();
        }
add
Code:
void setStoreItem(bool storeItem) {
            setIntAttr(ITEM_ATTRIBUTE_STOREITEM, static_cast<int64_t>(storeItem));
        }
        bool isStoreItem() const {
            if (hasAttribute(ITEM_ATTRIBUTE_STOREITEM)) {
                return getIntAttr(ITEM_ATTRIBUTE_STOREITEM) == 1;
            }
            return items[id].storeItem;
        }
and in container.cpp un-commit this
Code:
    // store items can be only moved into depot chest or store inbox
    /*if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }*/

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    /*if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
    */
so it should look like this
Code:
    // store items can be only moved into depot chest or store inbox
    if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
tested and work! rep ++ please and good luck
with this the items will be stored properly and this might fix the clonning issue too

Boa tarde tive esse problemas ao tentar compilar:
Gravidade Código Descrição Projeto Arquivo Linha Estado de Supressão
Erro C2374 'cylinder': redefinição; várias inicializações theforgottenserver C:\Users\PC\Desktop\TFS-1.5-Downgrades-8.0\src\container.cpp 313
 
I've solved this exactly today

so
in depotchest.h
commit this
Lua:
Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }
so it should look like this
Code:
/*Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }*/
in depotchest.cpp commit this
Diff:
Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
it should look like this
Code:
/*Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
*/
in item.h below
Code:
    bool isRune() const {
            return items[id].isRune();
        }
add
Code:
void setStoreItem(bool storeItem) {
            setIntAttr(ITEM_ATTRIBUTE_STOREITEM, static_cast<int64_t>(storeItem));
        }
        bool isStoreItem() const {
            if (hasAttribute(ITEM_ATTRIBUTE_STOREITEM)) {
                return getIntAttr(ITEM_ATTRIBUTE_STOREITEM) == 1;
            }
            return items[id].storeItem;
        }
and in container.cpp un-commit this
Code:
    // store items can be only moved into depot chest or store inbox
    /*if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }*/

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    /*if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
    */
so it should look like this
Code:
    // store items can be only moved into depot chest or store inbox
    if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
tested and work! rep ++ please and good luck
with this the items will be stored properly and this might fix the clonning issue too
thank you very much, testing on tfs 1.5 8.0 neikro, perfectly
 
I've solved this exactly today

so
in depotchest.h
commit this
Lua:
Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }
so it should look like this
Code:
/*Cylinder* getParent() const override;
        Cylinder* getRealParent() const override {
            return parent;
        }*/
in depotchest.cpp commit this
Diff:
Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
it should look like this
Code:
/*Cylinder* DepotChest::getParent() const
{
    if (parent) {
        return parent->getParent();
    }
    return nullptr;
}
*/
in item.h below
Code:
    bool isRune() const {
            return items[id].isRune();
        }
add
Code:
void setStoreItem(bool storeItem) {
            setIntAttr(ITEM_ATTRIBUTE_STOREITEM, static_cast<int64_t>(storeItem));
        }
        bool isStoreItem() const {
            if (hasAttribute(ITEM_ATTRIBUTE_STOREITEM)) {
                return getIntAttr(ITEM_ATTRIBUTE_STOREITEM) == 1;
            }
            return items[id].storeItem;
        }
and in container.cpp un-commit this
Code:
    // store items can be only moved into depot chest or store inbox
    /*if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }*/

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    /*if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
    */
so it should look like this
Code:
    // store items can be only moved into depot chest or store inbox
    if (item->isStoreItem() && !dynamic_cast<const DepotChest*>(this)) {
        return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
    }

    const Cylinder* cylinder = getParent();

    // don't allow moving items into container that is store item and is in store inbox
    if (isStoreItem() && dynamic_cast<const StoreInbox*>(cylinder)) {
        ReturnValue ret = RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
        if (!item->isStoreItem()) {
            ret = RETURNVALUE_CANNOTMOVEITEMISNOTSTOREITEM;
        }
        return ret;
    }
tested and work! rep ++ please and good luck
with this the items will be stored properly and this might fix the clonning issue too
Thank you very much, Felipe93!
Your solution has been of great help in resolving the Depot Chest issue in Nekiro's TFS 1.5 8.0 project. I appreciate your time and effort in sharing the solution with the community.
If you have more tips or solutions in the future, please don't hesitate to share them. Community collaboration is essential for projects like this to continue improving.
Thanks again, and good luck with your future projects.
 
Thank you very much, Felipe93!
Your solution has been of great help in resolving the Depot Chest issue in Nekiro's TFS 1.5 8.0 project. I appreciate your time and effort in sharing the solution with the community.
If you have more tips or solutions in the future, please don't hesitate to share them. Community collaboration is essential for projects like this to continue improving.
Thanks again, and good luck with your future projects.
he is banned xd
 
Back
Top