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

Method spawnStagehand

source/game/scripting/StarWorldLuaBindings.cpp:994–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992 }
993
994 Maybe<EntityId> WorldCallbacks::spawnStagehand(
995 World* world, Vec2F const& spawnPosition, String const& typeName, Json const& overrides) {
996 auto stagehandDatabase = Root::singleton().stagehandDatabase();
997 try {
998 auto stagehand = stagehandDatabase->createStagehand(typeName, overrides);
999 stagehand->setPosition(spawnPosition);
1000 world->addEntity(stagehand);
1001 return stagehand->inWorld() ? stagehand->entityId() : Maybe<EntityId>();
1002 } catch (StarException const& exception) {
1003 Logger::warn(
1004 "Could not spawn Stagehand of type '{}', exception caught: {}", typeName, outputException(exception, false));
1005 return {};
1006 }
1007 }
1008
1009 Maybe<EntityId> WorldCallbacks::spawnProjectile(World* world,
1010 String const& projectileType,

Callers

nothing calls this directly

Calls 8

singletonClass · 0.85
stagehandDatabaseMethod · 0.80
createStagehandMethod · 0.80
entityIdMethod · 0.80
outputExceptionFunction · 0.50
setPositionMethod · 0.45
addEntityMethod · 0.45
inWorldMethod · 0.45

Tested by

no test coverage detected