fix(trade): tell both players a trade is about to be performed

Once both players had given their final accept, live sent each an empty
ServerTradeUpdate with bAboutToPerform set, and the client shows the trade
as complete (LWOTradeComponent::SendMessage, "SetTradeComplete").
The server only sent the accepts that close the window. It now sends the
update first, before the items move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-11 07:00:53 -06:00
parent 9bb1ecdd22
commit 85975b753e

View File

@@ -150,6 +150,17 @@ void Trade::SetAccepted(LWOOBJID participant, bool value) {
}
if (m_AcceptedA && m_AcceptedB) {
// Live told the players the trade was about to be performed (an empty ServerTradeUpdate with
// bAboutToPerform); their clients show the trade as complete (LWOTradeComponent::SendMessage,
// "SetTradeComplete")
for (auto* const participant : { GetParticipantAEntity(), GetParticipantBEntity() }) {
if (!participant) continue;
GameMessages::ServerTradeUpdate aboutToPerform;
aboutToPerform.target = participant->GetObjectID();
aboutToPerform.bAboutToPerform = true;
aboutToPerform.Send(participant->GetSystemAddress());
}
auto* entityB = GetParticipantBEntity();
if (entityB != nullptr) {