summaryrefslogtreecommitdiffhomepage
path: root/src/character.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-18 13:22:31 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-18 13:22:31 +0100
commit2618f4c486848c5e3b080eb77a0c0c143932240e (patch)
tree6f4f106f98f3fc73bc7de6ae7a96322079169dff /src/character.cpp
parentdb6e21d50d426d0745d844f3166da296a40435e9 (diff)
fix few asserts
Diffstat (limited to 'src/character.cpp')
-rw-r--r--src/character.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/character.cpp b/src/character.cpp
index 9c69e061..94f0b7ac 100644
--- a/src/character.cpp
+++ b/src/character.cpp
@@ -52,11 +52,15 @@ constexpr auto arrows_to_dir(bool L, bool R, bool U, bool D)
} // namespace
character_proto::character_proto(const character_proto&) = default;
-character_proto::character_proto() = default;
character_proto::~character_proto() noexcept = default;
character_proto& character_proto::operator=(const character_proto&) = default;
character::~character() = default;
+character_proto::character_proto()
+{
+ type = entity_type::character;
+}
+
bool character_proto::operator==(const entity_proto& e0) const
{
if (type != e0.type)
@@ -144,6 +148,7 @@ character::character(std::uint64_t id, struct chunk& c, entity_type type, const
name = "(Unnamed)"_s;
if (!atlas)
atlas = loader.anim_atlas("npc-walk", loader.ANIM_PATH);
+ fm_assert(atlas->check_rotation(r));
entity::set_bbox_(offset, bbox_offset, Vector2ub(iTILE_SIZE2/2), pass);
}