MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / importPlayerController

Method importPlayerController

src/logic/PlayerController.cpp:1587–1603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1585}
1586
1587Handle::EntityHandle PlayerController::importPlayerController(World::WorldInstance& world, const json& j)
1588{
1589 unsigned int instanceSymbol = j["scriptObj"]["instanceSymbol"];
1590
1591 // Create npc
1592 Handle::EntityHandle e = VobTypes::Wld_InsertNpc(world, instanceSymbol);
1593
1594 if (!e.isValid())
1595 return Handle::EntityHandle::makeInvalidHandle();
1596
1597 VobTypes::NpcVobInformation npc = VobTypes::asNpcVob(world, e);
1598
1599 // Load controller-values
1600 npc.playerController->importObject(j);
1601
1602 return e;
1603}
1604
1605void PlayerController::die(Handle::EntityHandle attackingNPC)
1606{

Callers

nothing calls this directly

Calls 2

isValidMethod · 0.45
importObjectMethod · 0.45

Tested by

no test coverage detected