Component now stores whether or not it is a runtime component
This commit is contained in:
@@ -19,7 +19,7 @@ namespace ecs::serial {
|
||||
auto components = entity->get_components();
|
||||
iohelper::write_length(os, components.size());
|
||||
for (auto [id, component] : components) {
|
||||
if (!component->_tagged()) {
|
||||
if (!component->_runtime) {
|
||||
auto functions = internal::functions.find(id);
|
||||
if (functions == internal::functions.end()) {
|
||||
throw std::runtime_error("No known serializer for id");
|
||||
@@ -29,8 +29,7 @@ namespace ecs::serial {
|
||||
iohelper::write<bool>(os, false);
|
||||
std::get<0>(internal::functions[id])(os, component);
|
||||
} else {
|
||||
TaggedComponent* tagged_component = (TaggedComponent*)component;
|
||||
auto new_id = ComponentID::get_id({tagged_component->_tag})[0];
|
||||
auto new_id = component->_id;
|
||||
auto functions = internal::functions.find(new_id);
|
||||
|
||||
if (functions == internal::functions.end()) {
|
||||
|
||||
Reference in New Issue
Block a user