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

Compiling TFS 1.3 - Reward Chest

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,084
Solutions
15
Reaction score
379
Location
Sweden
YouTube
Joriku
Hi,
Getting some errors. Any Ideas?
Following this:
e0021ff9b1214d5e36b2bdb9dcccf080.png


Luascript.h
Lua:
// Container
        static int luaContainerCreate(lua_State* L);
        static int luaContainerGetContentDescription(lua_State* L);
        static int luaContainerGetSize(lua_State* L);
        static int luaContainerGetCapacity(lua_State* L);
        static int luaContainerGetEmptySlots(lua_State* L);
        static int luaContainerGetContentDescription(lua_State* L);
        static int luaContainerGetItems(lua_State* L);
        static int luaContainerGetItemHoldingCount(lua_State* L);
        static int luaContainerGetItemCountById(lua_State* L);

        static int luaContainerGetItem(lua_State* L);
        static int luaContainerHasItem(lua_State* L);
        static int luaContainerAddItem(lua_State* L);
        static int luaContainerAddItemEx(lua_State* L);
        static int luaContainerGetCorpseOwner(lua_State* L);

Depotlocker.h
Lua:
/**
* The Forgotten Server - a free and open-source MMORPG server emulator
* Copyright (C) 2019  Mark Samman <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef FS_DEPOTLOCKER_H_53AD8E0606A34070B87F792611F4F3F8
#define FS_DEPOTLOCKER_H_53AD8E0606A34070B87F792611F4F3F8

#include "container.h"
#include "inbox.h"

class DepotLocker final : public Container
{
    public:
        explicit DepotLocker(uint16_t type);

        DepotLocker* getDepotLocker() override {
            return this;
        }
        const DepotLocker* getDepotLocker() const override {
            return this;
        }

        void removeInbox(Inbox* inbox);

        //serialization
        Attr_ReadValue readAttr(AttrTypes_t attr, PropStream& propStream) override;

        uint16_t getDepotId() const {
            return depotId;
        }
        void setDepotId(uint16_t depotId) {
            this->depotId = depotId;
        }

        void setMaxLockerItems(uint32_t maxitems) {
            maxSize = maxitems;
        }

        //cylinder implementations
        ReturnValue queryAdd(int32_t index, const Thing& thing, uint32_t count,
                uint32_t flags, Creature* actor = nullptr) const override;

        void postAddNotification(Thing* thing, const Cylinder* oldParent, int32_t index, cylinderlink_t link = LINK_OWNER) override;
        void postRemoveNotification(Thing* thing, const Cylinder* newParent, int32_t index, cylinderlink_t link = LINK_OWNER) override;

        bool canRemove() const override {
            return false;
        }

    private:
        uint16_t depotId;
};

#endif

Update#1
Moving uint32_t maxSize; from Private to Public solves the issue with the maxSize.
container.h

Update#2
Removed
static int luaContainerGetContentDescription(lua_State* L);
In luascript.h
X2 existed because I putted an extra in, solved the issue.

Update#3
e1ed2f4b5a6bc8265626b5b18fbf8faa.png

Removed the double there aswell, need to check the int code tho. It's diffrent, but that solved the issue but might cause something to bug with the reward container

Now onto this, why is this happening? :eek:
a39fa40ef74a024d37e930d7c9b2f8b1.png
 
Last edited:
Back
Top