Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarItemDrop.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-08-18 21:48:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-08-18 21:48:09 +1000
commitcd36a269fd1ccfd40ec09aca25285c6f9a875c43 (patch)
tree91636b3f3dae3ce7caaedca38d99a061365c884b /source/game/StarItemDrop.cpp
parentb51e174bdc158187fc110dc4a947946d3dc329c1 (diff)
Account for latency predicting item drop pickup
Diffstat (limited to 'source/game/StarItemDrop.cpp')
-rw-r--r--source/game/StarItemDrop.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/game/StarItemDrop.cpp b/source/game/StarItemDrop.cpp
index 8114de4..3ff0d37 100644
--- a/source/game/StarItemDrop.cpp
+++ b/source/game/StarItemDrop.cpp
@@ -300,10 +300,10 @@ bool ItemDrop::canTake() const {
return m_mode.get() == Mode::Available && m_owningEntity.get() == NullEntityId && !m_item->empty();
}
-ItemPtr ItemDrop::takeBy(EntityId entityId) {
+ItemPtr ItemDrop::takeBy(EntityId entityId, float timeOffset) {
if (canTake()) {
m_owningEntity.set(entityId);
- m_dropAge.setElapsedTime(0.0);
+ m_dropAge.setElapsedTime(timeOffset);
m_mode.set(Mode::Taken);
setPersistent(false);