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

Method containerTakeAt

source/game/scripting/StarWorldLuaBindings.cpp:1672–1682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1670 }
1671
1672 Json WorldEntityCallbacks::containerTakeAt(World* world, EntityId entityId, size_t offset) {
1673 if (auto container = world->get<ContainerObject>(entityId)) {
1674 auto itemDb = Root::singleton().itemDatabase();
1675 if (offset < container->containerSize()) {
1676 if (auto res = container->takeItems(offset).result())
1677 return itemDb->toJson(*res);
1678 }
1679 }
1680
1681 return Json();
1682 }
1683
1684 Json WorldEntityCallbacks::containerTakeNumItemsAt(World* world, EntityId entityId, size_t offset, int const& count) {
1685 if (auto container = world->get<ContainerObject>(entityId)) {

Callers

nothing calls this directly

Calls 7

singletonClass · 0.85
JsonClass · 0.85
itemDatabaseMethod · 0.80
resultMethod · 0.80
containerSizeMethod · 0.45
takeItemsMethod · 0.45
toJsonMethod · 0.45

Tested by

no test coverage detected