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

Method takeItems

source/game/objects/StarContainerObject.cpp:263–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263RpcPromise<ItemPtr> ContainerObject::takeItems(size_t slot, size_t count) {
264 if (isSlave()) {
265 return world()->sendEntityMessage(entityId(), "takeItems", {slot, count}).wrap([](Json res) {
266 return Root::singleton().itemDatabase()->item(ItemDescriptor(res));
267 });
268 } else {
269 return RpcPromise<ItemPtr>::createFulfilled(doTakeItems(slot, count));
270 }
271}
272
273RpcPromise<ItemPtr> ContainerObject::swapItems(size_t slot, ItemPtr const& items, bool tryCombine) {
274 if (isSlave()) {

Callers 3

doTakeItemsMethod · 0.45
containerTakeAtMethod · 0.45

Calls 6

singletonClass · 0.85
ItemDescriptorClass · 0.85
itemDatabaseMethod · 0.80
wrapMethod · 0.45
sendEntityMessageMethod · 0.45
itemMethod · 0.45

Tested by

no test coverage detected