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

Method spawnVehicle

source/game/scripting/StarWorldLuaBindings.cpp:1032–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030 }
1031
1032 Maybe<EntityId> WorldCallbacks::spawnVehicle(
1033 World* world, String const& vehicleName, Vec2F const& pos, Json const& extraConfig) {
1034 auto vehicleDatabase = Root::singleton().vehicleDatabase();
1035 auto vehicle = vehicleDatabase->create(vehicleName, extraConfig);
1036 vehicle->setPosition(pos);
1037 world->addEntity(vehicle);
1038 if (vehicle->inWorld())
1039 return vehicle->entityId();
1040 return {};
1041 }
1042
1043 double WorldCallbacks::time(World* world) {
1044 return world->epochTime();

Callers

nothing calls this directly

Calls 7

singletonClass · 0.85
vehicleDatabaseMethod · 0.80
entityIdMethod · 0.80
createMethod · 0.45
setPositionMethod · 0.45
addEntityMethod · 0.45
inWorldMethod · 0.45

Tested by

no test coverage detected