Skip to content

Commit

Permalink
Use RUNTIME_VERIFY_OR_DEBUG_ASSERT in setDelayFrames()
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer authored Jan 9, 2025
1 parent ea2d1fa commit 29be47c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/engine/effects/engineeffectsdelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ class EngineEffectsDelay final : public EngineObject {
/// a zero delay. When is the delay set, the EngineEffectsDelay::process
/// method works with this set delay value until the value is changed.
void setDelayFrames(SINT delayFrames) {
if (delayFrames < 0) {
DEBUG_ASSERT_UNREACHABLE(false);
RUNTIME_VERIFY_OR_DEBUG_ASSERT(delayFrames >= 0) {
delayFrames = 0;
}
if (delayFrames > kMaxDelayFrames) {
DEBUG_ASSERT_UNREACHABLE(false);
VERIFY_OR_DEBUG_ASSERT(delayFrames <= kMaxDelayFrames) {
delayFrames = kMaxDelayFrames;
}

Expand Down

0 comments on commit 29be47c

Please sign in to comment.