MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / takeBy

Method takeBy

source/game/StarItemDrop.cpp:349–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349ItemPtr ItemDrop::takeBy(EntityId entityId, float timeOffset) {
350 if (canTake()) {
351 m_owningEntity.set(entityId);
352 m_dropAge.setElapsedTime(timeOffset);
353 m_mode.set(Mode::Taken);
354 setPersistent(false);
355
356 return m_item->take();
357 } else {
358 return {};
359 }
360}
361
362ItemPtr ItemDrop::take() {
363 if (canTake()) {

Callers 3

updateMethod · 0.80
handleIncomingPacketsMethod · 0.80
takeItemDropMethod · 0.80

Calls 3

setElapsedTimeMethod · 0.80
setMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected