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

Problem with charges.

Piotrek1447

Member
Joined
Jun 1, 2007
Messages
658
Reaction score
16
Location
Rzeszów, Poland
I have 1000 charges in my enchanted weapon but when i attack monster then charges automatically set to 231. In sources i make some modification like this:

In item.cpp
Code:
uint8_t _charges = 1;
            if(!propStream.GET_UCHAR(_charges))
on this
Code:
uint16_t _charges = 1;
            if(!propStream.GET_USHORT(_charges))
In item.h
Code:
uint8_t charges;
on this
Code:
uint16_t charges;
and i added this:
Code:
if(getWeaponType() != WEAPON_DIST)
                {
                    if(getItemCharge() > 0)
                    {
                        s <<  " that has " << (int)getItemCharge() << " charges left";
                    }
                }
What other changes i must make?
Sorry for my English.
 
I have 1000 charges in my enchanted weapon but when i attack monster then charges automatically set to 231. In sources i make some modification like this:

In item.cpp
Code:
uint8_t _charges = 1;
            if(!propStream.GET_UCHAR(_charges))
on this
Code:
uint16_t _charges = 1;
            if(!propStream.GET_USHORT(_charges))
In item.h
Code:
uint8_t charges;
on this
Code:
uint16_t charges;
and i added this:
Code:
if(getWeaponType() != WEAPON_DIST)
                {
                    if(getItemCharge() > 0)
                    {
                        s <<  " that has " << (int)getItemCharge() << " charges left";
                    }
                }
What other changes i must make?
Sorry for my English.
Serialization, unserialization and so.
On your place I wouldn't change this right now, since its not compatible with map serialization.
 
Back
Top