mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 01:41:40 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user