[FIXED] Weight-calculation is still bugged
- 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
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.
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
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).giwo wrote:Very nice work, Grim.
-
Maarc
- Developer
- Posts: 576
- Joined: Sat Mar 27, 2004 6:22 am
- Location: Fleet, UK
- Has thanked: 0
- Been thanked: 0
- Contact:
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.
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
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.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.
-
Grimson
- Developer
- Posts: 802
- Joined: Sat Jun 04, 2005 1:52 am
- Location: Germany
- Has thanked: 0
- Been thanked: 0
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.
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.