[Problem] Item Lock 5165

06/09/2010 00:10 Jay10291#1
I added item lock to my server and I'm getting the same error 3 times. I don't know what it means, I even google'd it >.>

Quote:
cannot implicitly convert type 'byte' to 'bool'
1.
Code:
P.WriteByte(I.Enchant);
            P.Move(6);
            if [COLOR="Red"][U](I.Locked)[/U][/COLOR]
            {
                P.WriteInt16(3);
            }
2.
Code:
P.WriteByte(I.Enchant);
                P.Move(6);
                if [U][COLOR="Red"](I.Locked)[/COLOR][/U]
                    P.WriteInt16(3);
                else P.WriteInt16(0);
                if (I.Color == 0)
                    I.Color = (Game.Item.ArmorColor)new Random().Next(1, 9);
                P.WriteInt32((uint)I.Color);
                P.WriteInt32(I.Progress);
3.
Code:
P.WriteByte(I.Enchant);
                P.Move(6);
                if [U][COLOR="Red"](I.Locked)[/COLOR][/U]
                    P.WriteInt16(3);
                else P.WriteInt16(0);
                if (I.Color == 0)
                    I.Color = (Game.Item.ArmorColor)new Random().Next(1, 9);
                P.WriteInt32((uint)I.Color);
                P.WriteInt32(I.Progress);
Changing "public byte Locked = 0;" to "public bool Locked = 0;" just made more errors.
06/09/2010 00:17 ImmuneOne#2
Quote:
Originally Posted by Jay10291 View Post
I added item lock to my server and I'm getting the same error 3 times. I don't know what it means, I even google'd it >.>


1.
Code:
P.WriteByte(I.Enchant);
            P.Move(6);
            if [COLOR="Red"][U](I.Locked)[/U][/COLOR]
            {
                P.WriteInt16(3);
            }
2.
Code:
P.WriteByte(I.Enchant);
                P.Move(6);
                if [U][COLOR="Red"](I.Locked)[/COLOR][/U]
                    P.WriteInt16(3);
                else P.WriteInt16(0);
                if (I.Color == 0)
                    I.Color = (Game.Item.ArmorColor)new Random().Next(1, 9);
                P.WriteInt32((uint)I.Color);
                P.WriteInt32(I.Progress);
3.
Code:
P.WriteByte(I.Enchant);
                P.Move(6);
                if [U][COLOR="Red"](I.Locked)[/COLOR][/U]
                    P.WriteInt16(3);
                else P.WriteInt16(0);
                if (I.Color == 0)
                    I.Color = (Game.Item.ArmorColor)new Random().Next(1, 9);
                P.WriteInt32((uint)I.Color);
                P.WriteInt32(I.Progress);
Changing "public byte Locked = 0;" to "public bool Locked = 0;" just made more errors.
Code:
if(I.Locked) to if (I.Locked == 1) // true
if (!I.Locked) to if(I.Locked == 0) // false
06/09/2010 00:20 ImmuneOne#3
Actually, you should read some tutorials about basic defining. How could a bool be used as a integral type?
06/09/2010 07:10 dragon89928#4
I gave up on item locking since if you do item locking, you'd have to do trade partners. What I did to get through all this is just make every character a merchant. By doing this it doesn't bitch about item lock nor will it bitch about the "cant drop this because its the highest bp blah blah".
06/09/2010 22:36 Jay10291#5
When I change (I.Locked) to (I.Locked == 1) it gets rid of the erros I was having but when I log into the game I get an error in the console and Item Lock still doesnt work.
Error- Unable to read beyond the end of the stream.
character.cs line 1226
database.cs line 911

@dragon89928
Did you make it so all new characters are automatically merchants? If you did, can you tell m how you did it? PM me =p
06/10/2010 00:34 joshvette001#6
We would have to see honestly what line 1226 in character.cs is and what is kind of around it and what is database line 911 and what it pertains to for what database function like save char etc.... or is it a get function