mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
implement player entity
This commit is contained in:
parent
49aa64a033
commit
487ba84517
8 changed files with 24 additions and 12 deletions
|
|
@ -66,6 +66,7 @@ entityid_t Entities::spawn(
|
|||
dynamic::Map_sptr saved,
|
||||
entityid_t uid)
|
||||
{
|
||||
std::cout << "spawn entity " << def.name << std::endl;
|
||||
auto rig = level->content->getRig(def.rigName);
|
||||
if (rig == nullptr) {
|
||||
throw std::runtime_error("rig "+def.rigName+" not found");
|
||||
|
|
@ -108,8 +109,10 @@ entityid_t Entities::spawn(
|
|||
componentName, entity_funcs_set {}, nullptr);
|
||||
scripting.components.emplace_back(std::move(component));
|
||||
}
|
||||
std::cout << "on_entity_spawn" << std::endl;
|
||||
scripting::on_entity_spawn(
|
||||
def, id, scripting.components, std::move(args), std::move(saved));
|
||||
std::cout << "done" << std::endl;
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue