skypjack / entt

Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
https://github.com/skypjack/entt/wiki
MIT License
9.6k stars 844 forks source link

Serialization of "dead" components #1118

Closed skaarj1989 closed 1 month ago

skaarj1989 commented 3 months ago

When in_place_delete=true is set for a given component, the snapshot saves "dead" components. This leads to an (indirect) error in the snapshot_loader https://github.com/skypjack/entt/blob/fedcb920ce0068c35ffbc66fd4e84864e6ef71ef/src/entt/entity/snapshot.hpp#L208 entt::null is skipped, but an archive (at least cereal) expects a component.

Repro code: https://godbolt.org/z/a3cn8j9Ko