summaryrefslogtreecommitdiffhomepage
path: root/src/character.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-05-10 14:11:02 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-05-11 00:33:47 +0200
commitf29ee994108bf443de4aeeabd7519f13ca4b7a4d (patch)
tree6f1ad0d719dcfcc5c5c199ce1d25c5531550835d /src/character.cpp
parentaad0d8fd8e2d3409db1b591c6dbc401e02eaeef3 (diff)
wip virtual entity stuff
Diffstat (limited to 'src/character.cpp')
-rw-r--r--src/character.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/character.cpp b/src/character.cpp
index d75070e8..88a575f9 100644
--- a/src/character.cpp
+++ b/src/character.cpp
@@ -92,6 +92,7 @@ character_proto& character_proto::operator=(const character_proto&) = default;
character_proto::character_proto()
{
type = entity_type::character;
+ atlas = loader.anim_atlas("npc-walk", loader.ANIM_PATH);
}
bool character_proto::operator==(const entity_proto& e0) const
@@ -215,8 +216,6 @@ character::character(object_id id, struct chunk& c, const character_proto& proto
{
if (!name)
name = "(Unnamed)"_s;
- if (!atlas)
- const_cast<std::shared_ptr<anim_atlas>&>(atlas) = loader.anim_atlas("npc-walk", loader.ANIM_PATH);
fm_soft_assert(atlas->check_rotation(r));
entity::set_bbox_(offset, bbox_offset, Vector2ub(iTILE_SIZE2/2), pass);
}