Skip to content

Commit

Permalink
Add script timer asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
dscharrer committed Jul 19, 2016
1 parent 6e504c6 commit 6ede91f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/scene/ChangeLevel.cpp
Expand Up @@ -1130,6 +1130,7 @@ static long ARX_CHANGELEVEL_Push_IO(const Entity * io, long level) {
ats->script = 1;

ats->remaining = (timer.start + timer.interval) - timm;
arx_assert(ats->remaining <= timer.interval);

if(ats->remaining < 0)
ats->remaining = 0;
Expand Down
1 change: 1 addition & 0 deletions src/script/Script.cpp
Expand Up @@ -1838,6 +1838,7 @@ void ARX_SCRIPT_Timer_Check() {

ArxInstant now = arxtime.now_ul();
ArxInstant fire_time = st->start + st->interval;
arx_assert(st->start <= now);
if(fire_time > now) {
// Timer not ready to fire yet
continue;
Expand Down

0 comments on commit 6ede91f

Please sign in to comment.