diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-08-18 16:54:47 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-08-18 16:54:47 +1000 |
commit | aa0ef06ac64542183a6f66bbfcad7d4cb45e9fd9 (patch) | |
tree | 25827d6a4853621526244a1b6248a9be1e5a5654 /source/game/StarWorldClient.cpp | |
parent | 50ec1a040649bdf9020a8da5453a703beb13453d (diff) |
Predict item drop animation client-side
Diffstat (limited to 'source/game/StarWorldClient.cpp')
-rw-r--r-- | source/game/StarWorldClient.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp index 0b15afd..de324ad 100644 --- a/source/game/StarWorldClient.cpp +++ b/source/game/StarWorldClient.cpp @@ -1125,8 +1125,10 @@ void WorldClient::update(float dt) { // If the drop is within DropDist and not owned, request it. if (itemDrop->canTake() && !m_requestedDrops.contains(itemDrop->entityId()) && distSquared < square(DropDist)) { m_requestedDrops.add(itemDrop->entityId()); - if (m_mainPlayer->itemsCanHold(itemDrop->item()) != 0) + if (m_mainPlayer->itemsCanHold(itemDrop->item()) != 0) { + itemDrop->takeBy(m_mainPlayer->entityId()); m_outgoingPackets.append(make_shared<RequestDropPacket>(itemDrop->entityId())); + } } } } else { |