mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-01 09:27:14 +00:00
fix(currency): SetCurrency names its source the way live did
Live filled SetCurrency's source fields per source type (16,816 decoded live SetCurrency): pickups carry the position the client picked the coins up at (the one in its PickupCurrency) and no source; mission, achievement and activity rewards name the player (object and LOT 1); vendor buys, sells and buybacks name the vendor and its LOT; trades carry the trade ID; death, mail and everything else name nothing. No live SetCurrency sets loot_type. DLU wrote a present source LOT of 0, no object and a zero position for all of them. The position is the one the client uses: for pickups it projects it to the screen as the start of the coin counter animation (LWOCharacterComponent::SetCurrency), so it started from the world origin before. PickupCurrency now reads that position (the client always sends it). The trade ID is an 8-byte object ID in the client; DLU declared it 4 bytes, which only never broke because it was never set. Check: pick up coins and watch the coin counter animate from where the coins were; buy and sell at a vendor, finish a mission and trade coins with another player, and the coin total updates each time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,8 +53,7 @@ namespace GameMessages {
|
||||
NiPoint3 position{ NiPoint3Constant::ZERO };
|
||||
LOT sourceLOT{ LOT_NULL }; // optional
|
||||
LWOOBJID sourceID{ LWOOBJID_EMPTY }; // optional
|
||||
// optional (default 0). DLU writes it as an int32_t; lu_packets has an object ID (8 bytes). Only ever 0.
|
||||
int32_t sourceTradeID{ 0 };
|
||||
LWOOBJID sourceTradeID{ LWOOBJID_EMPTY }; // optional; the client reads an object ID (8 bytes)
|
||||
eLootSourceType sourceType{ eLootSourceType::NONE }; // optional
|
||||
};
|
||||
|
||||
@@ -109,6 +108,7 @@ namespace GameMessages {
|
||||
void Handle(Entity& entity, const SystemAddress& sysAddr) override;
|
||||
|
||||
uint32_t currency{};
|
||||
NiPoint3 position{ NiPoint3Constant::ZERO }; // where the client picked the coins up
|
||||
};
|
||||
|
||||
// Client -> server.
|
||||
|
||||
Reference in New Issue
Block a user