[FIXED] Weight-calculation is still bugged

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Weight-calculation is still bugged

Post 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.
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

I going to take a look at this.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

This should be fixed now.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Very nice work, Grim. :)
Scott
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post 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).
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post 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.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post 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.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post 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.
Scott
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post 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.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post 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.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

There is still something wrong, if you create a new char his weight is quite to high.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post 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.
Post Reply