Page 1 of 1
Weight-calculation is still bugged
Posted: Thu Mar 09, 2006 6:39 pm
by Xuri
Using 0.98-3.5 Release version, weight calculation for normal player characters is still bugged. Unequip all items from a newbie character (put them on the ground), then start dragging them one by one into the backpack.
The displayed weight in status gump will rise for some items, sink for some, and not change at all for others.
Posted: Fri Mar 10, 2006 11:36 pm
by Grimson
I going to take a look at this.
Posted: Sat Mar 11, 2006 3:21 am
by Grimson
This should be fixed now.
Posted: Sat Mar 11, 2006 3:23 am
by giwo
Very nice work, Grim.

Posted: Sat Mar 11, 2006 3:27 am
by Grimson
giwo wrote:Very nice work, Grim.

Thanks, I'm still thinking of a way to force a weight recalculation of already "bugged" chars. I'm thinking about adding a version number to chars and use it to force some updates like this (it might not be the last time we need to update/recalculate something on already existing chars).
Posted: Sat Mar 11, 2006 4:20 am
by Maarc
Personally, I'd suggest tools, rather than embedding lots of complex logic into the server that would only exist, really, for one or two runs. Trying to keep the server code as slim as possible I think is a good thing.
If it helps, I'll try and backport the ToolAPI to C++ sooner, rather than later, so that we can do cross-platform stuff more readily.
Posted: Sat Mar 11, 2006 4:27 am
by Grimson
Maarc wrote:Personally, I'd suggest tools, rather than embedding lots of complex logic into the server that would only exist, really, for one or two runs. Trying to keep the server code as slim as possible I think is a good thing.
If it helps, I'll try and backport the ToolAPI to C++ sooner, rather than later, so that we can do cross-platform stuff more readily.
I've already implemented a version number for chars. It's quite simple, and when there is a better solution it can be taken out without a problem.
Posted: Sat Mar 11, 2006 4:35 am
by giwo
It's best not to add things that can or should be taken out later.
For the very simple fact they never will be.
Bugged characters (which will be very few given that we have few users) will simply have to be re-created.
Posted: Sat Mar 11, 2006 4:40 am
by Grimson
giwo wrote:It's best not to add things that can or should be taken out later.
For the very simple fact they never will be.

Doh, I just put it on CVS.
Posted: Sat Mar 11, 2006 1:34 pm
by Grimson
Ok, removed the char version number again.
Giwo can you add a function to your Character Viewer that sets the weight of chars to 0, as this will also force a weight recalculation on world loads.
Posted: Sun Mar 12, 2006 11:10 pm
by Grimson
There is still something wrong, if you create a new char his weight is quite to high.
Posted: Mon Mar 13, 2006 12:42 am
by Grimson
Found it:
In CPICreateCharacter::newbieItems() we first created a "fake item" for LOWERGARMENT and UPPERGARMENT and placed it in the players backpack. Then later we changed it's ID to the item we actually wanted. But the weight of this "fake item" was already added to the player and his backpack, which was 0x255 as the ID used for the fake item was the ID of a stone step.