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

Attributes not being saved on LOGOUT/LOGIN

Derlexy

Intermediate OT User
Joined
Jun 29, 2011
Messages
219
Reaction score
101
Hello... Im working on new item attributes to my server. I got everything working so far, and now i got a problem: not all attributes from items are being saved when player logout/login.

Before logout:
Code:
20:26 You see a magic sword +5 (Atk:48 Def:37).
Item Class 4.
It weighs 42.00 oz.
It's the Sword of Valor.
[Attributes]
Defense +2
Speed +3
Mana +50
Magic +1
ItemID: [3288].
Position: [X: 32347] [Y: 32215] [Z: 7].

After login:
Code:
20:27 You see a magic sword +5 (Atk:48 Def:37).
Item Class 4.
It weighs 42.00 oz.
It's the Sword of Valor.
[Attributes]
Defense +2
Speed +3
ItemID: [3288].
Position: [X: 32347] [Y: 32215] [Z: 7].

While in game, all the attributes are working fine. Even the effects of the attributes are working fine. The problem is only when i logout and login back. Looks like the items attributes (all of them) are not being saved into dabatase, only some...

My attribute list at enum.h:
C++:
enum itemAttrTypes : uint64_t {
    ITEM_ATTRIBUTE_NONE,

    ITEM_ATTRIBUTE_ACTIONID = 1 << 0,
    ITEM_ATTRIBUTE_MOVEMENTID = 1 << 1,
    ITEM_ATTRIBUTE_DESCRIPTION = 1 << 2,
    ITEM_ATTRIBUTE_TEXT = 1 << 3,
    ITEM_ATTRIBUTE_DATE = 1 << 4,
    ITEM_ATTRIBUTE_WRITER = 1 << 5,
    ITEM_ATTRIBUTE_NAME = 1 << 6,
    ITEM_ATTRIBUTE_ARTICLE = 1 << 7,
    ITEM_ATTRIBUTE_PLURALNAME = 1 << 8,
    ITEM_ATTRIBUTE_WEIGHT = 1 << 9,
    ITEM_ATTRIBUTE_ATTACK = 1 << 10,
    ITEM_ATTRIBUTE_DEFENSE = 1 << 11,
    ITEM_ATTRIBUTE_ARMOR = 1 << 12,
    ITEM_ATTRIBUTE_SHOOTRANGE = 1 << 13,
    ITEM_ATTRIBUTE_OWNER = 1 << 14,
    ITEM_ATTRIBUTE_DURATION = 1 << 15,
    ITEM_ATTRIBUTE_DECAYSTATE = 1 << 16,
    ITEM_ATTRIBUTE_CORPSEOWNER = 1 << 17,
    ITEM_ATTRIBUTE_CHARGES = 1 << 18,
    ITEM_ATTRIBUTE_FLUIDTYPE = 1 << 19,
    ITEM_ATTRIBUTE_DOORID = 1 << 20,
    ITEM_ATTRIBUTE_KEYNUMBER = 1 << 21,
    ITEM_ATTRIBUTE_KEYHOLENUMBER = 1 << 22,
    ITEM_ATTRIBUTE_DOORQUESTNUMBER = 1 << 23,
    ITEM_ATTRIBUTE_DOORQUESTVALUE = 1 << 24,
    ITEM_ATTRIBUTE_DOORLEVEL = 1 << 25,
    ITEM_ATTRIBUTE_CHESTQUESTNUMBER = 1 << 26,
    ITEM_ATTRIBUTE_ITEMCLASS = 1 << 27,
    ITEM_ATTRIBUTE_UPGRADES = 1 << 28,
    ITEM_ATTRIBUTE_UPG_ATTACK = 1 << 29,
    ITEM_ATTRIBUTE_UPG_DEFENSE = 1 << 30,
    ITEM_ATTRIBUTE_UPG_ARMOR = static_cast<uint64_t>(1) << 31,
    ITEM_ATTRIBUTE_UPG_SPEED = static_cast<uint64_t>(1) << 32,
    ITEM_ATTRIBUTE_UPG_LEAN = static_cast<uint64_t>(1) << 33,
    ITEM_ATTRIBUTE_UPG_CAPACITY = static_cast<uint64_t>(1) << 34,
    ITEM_ATTRIBUTE_UPG_RANGE = static_cast<uint64_t>(1) << 35,
    ITEM_ATTRIBUTE_UPG_HEALTH = static_cast<uint64_t>(1) << 36,
    ITEM_ATTRIBUTE_UPG_MANA = static_cast<uint64_t>(1) << 37,
    ITEM_ATTRIBUTE_UPG_MAGIC = static_cast<uint64_t>(1) << 38,
    ITEM_ATTRIBUTE_UPG_SWORD = static_cast<uint64_t>(1) << 39,
    ITEM_ATTRIBUTE_UPG_AXE = static_cast<uint64_t>(1) << 40,
    ITEM_ATTRIBUTE_UPG_CLUB = static_cast<uint64_t>(1) << 41,
    ITEM_ATTRIBUTE_UPG_SHIELD = static_cast<uint64_t>(1) << 42,
    ITEM_ATTRIBUTE_UPG_DISTANCE = static_cast<uint64_t>(1) << 43,
};

Not posting everything, but i changed several other pieces of code to have attributes working. I pretty sure that it has something to do about the item saving on database, or something related, like not all the attributes being saved on blob field at database... Can someone help me?

Obs: TFS 1.2 (Nostalrius)
 
Last edited:
Did you implemented the save attribute and load it to the item?
What I would do is add some debug code (or even debug it) and check if it is saving the attribute and then loading it and checking if it is being loaded properly.
 
Did you implemented the save attribute and load it to the item?
What I would do is add some debug code (or even debug it) and check if it is saving the attribute and then loading it and checking if it is being loaded properly.
I agree with you, but this is why im asking for help... i dont know exactly how that save and load methods works...
 
Check your serialization and deserialization methods in item.cpp
I have it already, look:
C++:
bool Item::unserializeAttr(PropStream& propStream)
{
    uint8_t attr_type;
    while (propStream.read<uint8_t>(attr_type) && attr_type != 0) {
        Attr_ReadValue ret = readAttr(static_cast<AttrTypes_t>(attr_type), propStream);
        if (ret == ATTR_READ_ERROR) {
            return false;
        } else if (ret == ATTR_READ_END) {
            return true;
        }
    }
    return true;
}

bool Item::unserializeItemNode(FileLoader&, NODE, PropStream& propStream)
{
    return unserializeAttr(propStream);
}

void Item::serializeAttr(PropWriteStream& propWriteStream) const
{
    const ItemType& it = items[id];
    if (it.stackable || it.isFluidContainer() || it.isSplash()) {
        propWriteStream.write<uint8_t>(ATTR_COUNT);
        propWriteStream.write<uint8_t>(getSubType());
    }

    uint16_t charges = getCharges();
    if (charges != 0) {
        propWriteStream.write<uint8_t>(ATTR_CHARGES);
        propWriteStream.write<uint16_t>(charges);
    }

    if (it.moveable) {
        uint16_t actionId = getActionId();
        if (actionId != 0) {
            propWriteStream.write<uint8_t>(ATTR_ACTION_ID);
            propWriteStream.write<uint16_t>(actionId);
        }
    }

    const std::string& text = getText();
    if (!text.empty()) {
        propWriteStream.write<uint8_t>(ATTR_TEXT);
        propWriteStream.writeString(text);
    }

    const time_t writtenDate = getDate();
    if (writtenDate != 0) {
        propWriteStream.write<uint8_t>(ATTR_WRITTENDATE);
        propWriteStream.write<uint32_t>(writtenDate);
    }

    const std::string& writer = getWriter();
    if (!writer.empty()) {
        propWriteStream.write<uint8_t>(ATTR_WRITTENBY);
        propWriteStream.writeString(writer);
    }

    const std::string& specialDesc = getSpecialDescription();
    if (!specialDesc.empty()) {
        propWriteStream.write<uint8_t>(ATTR_DESC);
        propWriteStream.writeString(specialDesc);
    }

    if (hasAttribute(ITEM_ATTRIBUTE_DURATION)) {
        propWriteStream.write<uint8_t>(ATTR_DURATION);
        propWriteStream.write<uint32_t>(getIntAttr(ITEM_ATTRIBUTE_DURATION));
    }

    ItemDecayState_t decayState = getDecaying();
    if (decayState == DECAYING_TRUE || decayState == DECAYING_PENDING) {
        propWriteStream.write<uint8_t>(ATTR_DECAYING_STATE);
        propWriteStream.write<uint8_t>(decayState);
    }

    if (hasAttribute(ITEM_ATTRIBUTE_NAME)) {
        propWriteStream.write<uint8_t>(ATTR_NAME);
        propWriteStream.writeString(getStrAttr(ITEM_ATTRIBUTE_NAME));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_ARTICLE)) {
        propWriteStream.write<uint8_t>(ATTR_ARTICLE);
        propWriteStream.writeString(getStrAttr(ITEM_ATTRIBUTE_ARTICLE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_PLURALNAME)) {
        propWriteStream.write<uint8_t>(ATTR_PLURALNAME);
        propWriteStream.writeString(getStrAttr(ITEM_ATTRIBUTE_PLURALNAME));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_WEIGHT)) {
        propWriteStream.write<uint8_t>(ATTR_WEIGHT);
        propWriteStream.write<uint32_t>(getIntAttr(ITEM_ATTRIBUTE_WEIGHT));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_ATTACK)) {
        propWriteStream.write<uint8_t>(ATTR_ATTACK);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_ATTACK));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_ITEMCLASS)) {
        propWriteStream.write<uint8_t>(ATTR_ITEMCLASS);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_ITEMCLASS));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPGRADES)) {
        propWriteStream.write<uint8_t>(ATTR_UPGRADES);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_UPGRADES));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_ATTACK)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_ATTACK);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_ATTACK));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_DEFENSE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_DEFENSE);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_DEFENSE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_ARMOR)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_ARMOR);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_ARMOR));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_SPEED)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_SPEED);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_SPEED));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_LEAN)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_LEAN);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_LEAN));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_CAPACITY)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_CAPACITY);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_CAPACITY));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_RANGE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_RANGE);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_RANGE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_HEALTH)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_HEALTH);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_HEALTH));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_MANA)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_MANA);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_MANA));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_MAGIC)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_MAGIC);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_MAGIC));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_SWORD)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_SWORD);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_SWORD));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_AXE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_AXE);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_AXE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_CLUB)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_CLUB);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_CLUB));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_SHIELD)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_SHIELD);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_SHIELD));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_UPG_DISTANCE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_DISTANCE);
        propWriteStream.write<uint64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_DISTANCE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_DEFENSE)) {
        propWriteStream.write<uint8_t>(ATTR_DEFENSE);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_DEFENSE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_ARMOR)) {
        propWriteStream.write<uint8_t>(ATTR_ARMOR);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_ARMOR));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_SHOOTRANGE)) {
        propWriteStream.write<uint8_t>(ATTR_SHOOTRANGE);
        propWriteStream.write<uint8_t>(getIntAttr(ITEM_ATTRIBUTE_SHOOTRANGE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_KEYNUMBER)) {
        propWriteStream.write<uint8_t>(ATTR_KEYNUMBER);
        propWriteStream.write<uint16_t>(getIntAttr(ITEM_ATTRIBUTE_KEYNUMBER));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_KEYHOLENUMBER)) {
        propWriteStream.write<uint8_t>(ATTR_KEYHOLENUMBER);
        propWriteStream.write<uint16_t>(getIntAttr(ITEM_ATTRIBUTE_KEYHOLENUMBER));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_DOORLEVEL)) {
        propWriteStream.write<uint8_t>(ATTR_DOORLEVEL);
        propWriteStream.write<uint16_t>(getIntAttr(ITEM_ATTRIBUTE_DOORLEVEL));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_DOORQUESTNUMBER)) {
        propWriteStream.write<uint8_t>(ATTR_DOORQUESTNUMBER);
        propWriteStream.write<uint16_t>(getIntAttr(ITEM_ATTRIBUTE_DOORQUESTNUMBER));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_DOORQUESTVALUE)) {
        propWriteStream.write<uint8_t>(ATTR_DOORQUESTVALUE);
        propWriteStream.write<uint16_t>(getIntAttr(ITEM_ATTRIBUTE_DOORQUESTVALUE));
    }

    if (hasAttribute(ITEM_ATTRIBUTE_CHESTQUESTNUMBER)) {
        propWriteStream.write<uint8_t>(ATTR_CHESTQUESTNUMBER);
        propWriteStream.write<uint16_t>(getIntAttr(ITEM_ATTRIBUTE_CHESTQUESTNUMBER));
    }
}

My custom ones are the ones with the "UPG" prefix.
 
It looks like you have added new item attributes to your server and they are working fine in-game, but some of the attributes are not being saved to the database when the player logs out and logs back in. This could be due to a number of reasons, including the way the attributes are being stored in the database, the way they are being loaded from the database, or the way they are being updated.

One possibility is that not all of the new attributes are being saved to the blob field in the database. The blob field is used to store variable-length binary data, so it should be able to store all of the attributes, but it's possible that the code that saves the attributes to the database is not working correctly. You could try checking the code that saves the attributes to the database to make sure that all of the attributes are being saved correctly.

Another possibility is that the code that loads the attributes from the database is not working correctly. When the player logs in, the server needs to load all of the player's items and their attributes from the database. If the code that loads the attributes is not working correctly, it could be skipping some of the attributes. You could try checking the code that loads the attributes from the database to make sure that it's working correctly.

Finally, it's possible that the code that updates the attributes is not working correctly. When the player changes an item's attributes, the server needs to update the database with the new values. If the code that updates the attributes is not working correctly, it could be overwriting some of the attributes with their default values. You could try checking the code that updates the attributes to make sure that it's working correctly.

Without seeing more of your code and database structure, it's hard to give more specific advice. You may want to try debugging the code and checking the database to see if you can identify the problem
 
It looks like you have added new item attributes to your server and they are working fine in-game, but some of the attributes are not being saved to the database when the player logs out and logs back in. This could be due to a number of reasons, including the way the attributes are being stored in the database, the way they are being loaded from the database, or the way they are being updated.

One possibility is that not all of the new attributes are being saved to the blob field in the database. The blob field is used to store variable-length binary data, so it should be able to store all of the attributes, but it's possible that the code that saves the attributes to the database is not working correctly. You could try checking the code that saves the attributes to the database to make sure that all of the attributes are being saved correctly.

Another possibility is that the code that loads the attributes from the database is not working correctly. When the player logs in, the server needs to load all of the player's items and their attributes from the database. If the code that loads the attributes is not working correctly, it could be skipping some of the attributes. You could try checking the code that loads the attributes from the database to make sure that it's working correctly.

Finally, it's possible that the code that updates the attributes is not working correctly. When the player changes an item's attributes, the server needs to update the database with the new values. If the code that updates the attributes is not working correctly, it could be overwriting some of the attributes with their default values. You could try checking the code that updates the attributes to make sure that it's working correctly.

Without seeing more of your code and database structure, it's hard to give more specific advice. You may want to try debugging the code and checking the database to see if you can identify the problem
ChatGPT joined OTLand?
 
It looks like you have added new item attributes to your server and they are working fine in-game, but some of the attributes are not being saved to the database when the player logs out and logs back in. This could be due to a number of reasons, including the way the attributes are being stored in the database, the way they are being loaded from the database, or the way they are being updated.

One possibility is that not all of the new attributes are being saved to the blob field in the database. The blob field is used to store variable-length binary data, so it should be able to store all of the attributes, but it's possible that the code that saves the attributes to the database is not working correctly. You could try checking the code that saves the attributes to the database to make sure that all of the attributes are being saved correctly.

Another possibility is that the code that loads the attributes from the database is not working correctly. When the player logs in, the server needs to load all of the player's items and their attributes from the database. If the code that loads the attributes is not working correctly, it could be skipping some of the attributes. You could try checking the code that loads the attributes from the database to make sure that it's working correctly.

Finally, it's possible that the code that updates the attributes is not working correctly. When the player changes an item's attributes, the server needs to update the database with the new values. If the code that updates the attributes is not working correctly, it could be overwriting some of the attributes with their default values. You could try checking the code that updates the attributes to make sure that it's working correctly.

Without seeing more of your code and database structure, it's hard to give more specific advice. You may want to try debugging the code and checking the database to see if you can identify the problem
It looks like you have added new item attributes to your server and they are working fine in-game, but some of the attributes are not being saved to the database when the player logs out and logs back in. This could be due to a number of reasons, including the way the attributes are being stored in the database, the way they are being loaded from the database, or the way they are being updated:
All the attributes are being saved on the database and working ingame. What i mean: if i use two attributes per time, everything works. The problem is when i add more than 2 attributes to some item... Them, when i relog the item loses some attributes. But it is not a problem with some attrbiute in specific...

It is like the size of the attribute blob on database dont afford more than 2 attributes. But it makes no sence to me, cuz blob dont have a size limit on database.
 
It looks like you have added new item attributes to your server and they are working fine in-game, but some of the attributes are not being saved to the database when the player logs out and logs back in. This could be due to a number of reasons, including the way the attributes are being stored in the database, the way they are being loaded from the database, or the way they are being updated:
All the attributes are being saved on the database and working ingame. What i mean: if i use two attributes per time, everything works. The problem is when i add more than 2 attributes to some item... Them, when i relog the item loses some attributes. But it is not a problem with some attrbiute in specific...

It is like the size of the attribute blob on database dont afford more than 2 attributes. But it makes no sence to me, cuz blob dont have a size limit on database.
If you are certain that all the attributes are being saved correctly to the database and are working in-game, but some attributes are being lost when the player logs out and logs back in, then the issue might be related to the way you are loading the attributes from the database.

As you mentioned, the blob field in the database should be able to store all the attributes without any size limit, so it's unlikely that the problem is with the blob field. However, there could be a limit on the amount of data that can be loaded from the database at once, or there could be a problem with the way the data is being loaded.

One thing you could try is to check the code that loads the attributes from the database and see if there are any limits on the amount of data that can be loaded at once. If there are, you might need to modify the code to load the attributes in smaller chunks.

Another thing you could try is to check if the data is being truncated when it's loaded from the database. This could happen if the code that loads the data assumes a certain size for the blob field and doesn't account for larger data sizes.

You could also try logging the data as it's loaded from the database and see if any attributes are missing. This could help you identify where the problem is occurring.

It's also possible that there's a bug in the code that's causing the issue. In that case, you might need to do some more debugging to identify and fix the problem.
 
Guys, i finally managed to solve the problem. It was kinda simple actually. Just a mistake of mine. As we can see now, the attrbiutes are being stored correctly:

The problem was that i was storing a int32 and loading a int64:
Before:
C++:
if (hasAttribute(ITEM_ATTRIBUTE_UPG_DISTANCE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_DISTANCE);
        propWriteStream.write<int64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_DISTANCE));
    }
After:
C++:
if (hasAttribute(ITEM_ATTRIBUTE_UPG_DISTANCE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_DISTANCE);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_DISTANCE));
    }

Thank you all that tried to help me. The ChatGPT guy made me see that simple mistake i was trapped on. <3
 
Guys, i finally managed to solve the problem. It was kinda simple actually. Just a mistake of mine. As we can see now, the attrbiutes are being stored correctly:

The problem was that i was storing a int32 and loading a int64:
Before:
C++:
if (hasAttribute(ITEM_ATTRIBUTE_UPG_DISTANCE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_DISTANCE);
        propWriteStream.write<int64_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_DISTANCE));
    }
After:
C++:
if (hasAttribute(ITEM_ATTRIBUTE_UPG_DISTANCE)) {
        propWriteStream.write<uint8_t>(ATTR_UPG_DISTANCE);
        propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_UPG_DISTANCE));
    }

Thank you all that tried to help me. The ChatGPT guy made me see that simple mistake i was trapped on. <3
shared the link of this upgrade system
 
Back
Top