[Question] definition of CPs

12/30/2009 13:52 Sport#1
i'm having a problem with CPs it goes minus ..
and i've been told to find out the definition of CPs ..

and i don't know where the **** is definition of CPs stored at ..

can any one give me a little guide where to find that ? ( definition of CPs ) .

which file ?

...................
12/30/2009 14:20 ImmuneOne#2
Quote:
Originally Posted by Sport View Post
i'm having a problem with CPs it goes minus ..
and i've been told to find out the definition of CPs ..

and i don't know where the **** is definition of CPs stored at ..

can any one give me a little guide where to find that ? ( definition of CPs ) .

which file ?

...................
Character.cs, then change your definition type of CPs to uint.
12/30/2009 14:36 Sport#3
hmmm ,,, it's unit ..

and i found that ..

Code:
public uint CPs
        {
            get { return _CPs; }
            set
            {
                _CPs = value;
                if (Loaded)
                {
                    MyClient.AddSend(Packets.Status(EntityID, Status.CPs, _CPs));
                }
            }
        }
should i chane that value ? and make it unit ? ... or what :S
12/30/2009 16:22 Arcо#4
Quote:
Originally Posted by Sport View Post
hmmm ,,, it's unit ..

and i found that ..

Code:
public uint CPs
        {
            get { return _CPs; }
            set
            {
                _CPs = value;
                if (Loaded)
                {
                    MyClient.AddSend(Packets.Status(EntityID, Status.CPs, _CPs));
                }
            }
        }
should i chane that value ? and make it unit ? ... or what :S

Make it a int so it is unsigned.
This post should help.
[Only registered and activated users can see links. Click Here To Register...]
12/30/2009 17:25 .Guru#5
unsigned integer i think arco's already mentioned this instead of going from -2147483648 to 2147483648 it just goes from 0 to 4294967295.
12/30/2009 18:25 -impulse-#6
Quote:
Originally Posted by Hepatitis B View Post
unsigned integer i think arco's already mentioned this instead of going from -2147483648 to 2147483648 it just goes from 0 to 4294967295.
Indeed.

Quote:
Originally Posted by Sport View Post
hmmm ,,, it's unit ..

and i found that ..

Code:
public uint CPs
        {
            get { return _CPs; }
            set
            {
                _CPs = value;
                if (Loaded)
                {
                    MyClient.AddSend(Packets.Status(EntityID, Status.CPs, _CPs));
                }
            }
        }
should i chane that value ? and make it unit ? ... or what :S
try this:


Code:
public uint CPs
        {
            get { return _CPs; }
            set
            {
                if(value > 0)
                    _CPs = value;
                if (Loaded)
                {
                    MyClient.AddSend(Packets.Status(EntityID, Status.CPs, _CPs));
                }
            }
        }
It should work now...but I can not really understand why it would get under 0 when its a uint.
12/30/2009 19:04 .Guru#7
i think there was a bug with this, don't quite remember. the source (really lotf updated) has alot of bugs and i see alot of uint values go negative. (silvers/cps/etc).
12/30/2009 20:27 Korvacs#8
Probably incorrect use of pointers in the packet, making an unsigned integer back into a signed one again.
12/30/2009 20:59 Nullable#9
Unsigned integers should never decrement below 0, as Korvacs said probably misuse of pointers