diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-27 15:52:23 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-27 17:57:30 +0200 |
| commit | 364155032c228342e853c8f1661fea0c57f11c15 (patch) | |
| tree | c65963cae277f67511f5b1fe07ecf8d4ddb69d56 /src/character.cpp | |
| parent | 481fc7e9e2a58abcd1299ccdebcb4b0527b47815 (diff) | |
src: remove entity::update() 'bool' return value
Diffstat (limited to 'src/character.cpp')
| -rw-r--r-- | src/character.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/character.cpp b/src/character.cpp index 88a575f9..b05d8093 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -143,19 +143,19 @@ Vector2 character::ordinal_offset(Vector2b offset) const return Vector2(offset); } -bool character::update(size_t i, float dt) +void character::update(size_t i, float dt) { const auto new_r = arrows_to_dir(b_L, b_R, b_U, b_D); if (new_r == rotation{rotation_COUNT}) { delta = 0; - return false; + return; } int nframes = allocate_frame_time(dt); if (nframes == 0) - return false; + return; auto [_0, _1, _2] = rotation_to_similar(r); const Vector2 move_vecs[] = { @@ -164,7 +164,6 @@ bool character::update(size_t i, float dt) move_vec(rotation_to_vec(_2)), }; - bool ret = false; if (r != new_r) if (is_dynamic()) @@ -184,7 +183,7 @@ bool character::update(size_t i, float dt) auto off_i = Vector2i(offset_); if (can_move_to(off_i)) { - ret |= move_to(i, off_i, new_r); + move_to(i, off_i, new_r); ++frame %= atlas->info().nframes; goto done; } @@ -194,8 +193,6 @@ bool character::update(size_t i, float dt) done: (void)0; } - - return ret; } entity_type character::type() const noexcept { return entity_type::character; } |
