From 61d46a790cfde35bedf4283cbbcce06639cce1ec Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Mar 2023 10:42:54 +0100 Subject: src/entity: move type data member to vtable --- src/scenery.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/scenery.cpp') diff --git a/src/scenery.cpp b/src/scenery.cpp index a424351f..bfa69142 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -100,6 +100,8 @@ bool scenery_proto::operator==(const entity_proto& e0) const closing == s0.closing && interactive == s0.interactive; } +entity_type scenery::type() const noexcept { return entity_type::scenery; } + scenery::operator scenery_proto() const { scenery_proto ret; @@ -111,11 +113,10 @@ scenery::operator scenery_proto() const return ret; } -scenery::scenery(object_id id, struct chunk& c, entity_type type_, const scenery_proto& proto) : - entity{id, c, type_, proto}, sc_type{proto.sc_type}, active{proto.active}, +scenery::scenery(object_id id, struct chunk& c, const scenery_proto& proto) : + entity{id, c, proto}, sc_type{proto.sc_type}, active{proto.active}, closing{proto.closing}, interactive{proto.interactive} { - fm_assert(type == proto.type); } } // namespace floormat -- cgit v1.2.3