• 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 Unmovable items dissappearing from the houses after restart. [0.4]

marek12

Available for sprite works
Joined
Apr 8, 2020
Messages
398
Solutions
4
Reaction score
394
Hi again guys, I am facing now the problem with items that can't be moved being removed from the house after server restart.
I am 99.999999% sure this is coded in cpp (which I don't know completely), anyone can help me with this one so it's not going to remove unmovable items? :D

Example: when I create a blueberry bush inside a house it will remove it after restart, and that's logical but I want to fix that so it will not remove it.

And that's because I got exercise dummies on my server that players can buy and unwrap inside a house.
I know I may just make them movable, but I need them to be unmovable :D
Post automatically merged:

does it have to do something in here?
house.cpp
C++:
    ItemList moveList;
    for(HouseTileList::iterator it = houseTiles.begin(); it != houseTiles.end(); ++it)
    {
        for(uint32_t i = 0; i < (*it)->getThingCount(); ++i)
        {
            if(!(item = (*it)->__getThing(i)->getItem()))
                continue;

            if(item->isPickupable())
                moveList.push_back(item);
            else if((tmpContainer = item->getContainer()))
            {
                for(ItemList::const_iterator it = tmpContainer->getItems(); it != tmpContainer->getEnd(); ++it)
                    moveList.push_back(*it);
            }
        }
    }

and then here?


C++:
    else
    {
        for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it)
            g_game.internalRemoveItem(NULL, (*it), (*it)->getItemCount(), false, FLAG_NOLIMIT);
    }

    return true;
}
 
Last edited:
Solution
E
add

XML:
<attribute key="forceSerialize" value="1"/>

to the items you want to save on items.xml
add

XML:
<attribute key="forceSerialize" value="1"/>

to the items you want to save on items.xml
it does work. thanks a lot :)!
can you just tell me what this attribute does? so I don't have any unwanted action going on? :D
Post automatically merged:

is it just forcing to save the item?
 
Last edited:

Similar threads

Back
Top