mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
fix user component initialization exception handling & fix fatal error on uninitialized component access
This commit is contained in:
parent
4295af15cc
commit
28385f236c
2 changed files with 12 additions and 1 deletions
|
|
@ -71,6 +71,9 @@ dv::value Entity::serialize() const {
|
|||
if (!scripts.components.empty()) {
|
||||
auto& compsMap = root.object("comps");
|
||||
for (auto& comp : scripts.components) {
|
||||
if (comp->env == nullptr) {
|
||||
continue;
|
||||
}
|
||||
auto data =
|
||||
scripting::get_component_value(comp->env, SAVED_DATA_VARNAME);
|
||||
compsMap[comp->name] = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue