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

Method clearStagehand

source/game/StarCommandProcessor.cpp:537–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537String CommandProcessor::clearStagehand(ConnectionId connectionId, String const&) {
538 if (auto errorMsg = adminCheck(connectionId, "remove stagehands"))
539 return *errorMsg;
540
541 unsigned removed = 0;
542 bool done = m_universe->executeForClient(connectionId,
543 [&](WorldServer* world, PlayerPtr player) {
544 auto queryRect = RectF::withCenter(player->aimPosition(), Vec2F{2, 2});
545 for (auto stagehand : world->query<Stagehand>(queryRect)) {
546 world->removeEntity(stagehand->entityId(), true);
547 ++removed;
548 }
549 });
550 return done ? strf("Removed {} stagehands", removed) : "Invalid client state";
551}
552
553String CommandProcessor::spawnLiquid(ConnectionId connectionId, String const& argumentString) {
554 if (auto errorMsg = adminCheck(connectionId, "spawn liquid"))

Callers

nothing calls this directly

Calls 5

strfFunction · 0.85
executeForClientMethod · 0.80
entityIdMethod · 0.80
aimPositionMethod · 0.45
removeEntityMethod · 0.45

Tested by

no test coverage detected