aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-lists.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2019-06-29 15:05:26 +0200
committerEugene Sandulenko2019-09-03 17:17:05 +0200
commit42ea7a97b0e562961a6c54140d5ac412fde38974 (patch)
treefcc08293c6ee0fc80a529237b57531d4644ab5f0 /engines/hdb/ai-lists.cpp
parent9182e0df177eb4c2c8ceb819c0f7fbca1064146d (diff)
downloadscummvm-rg350-42ea7a97b0e562961a6c54140d5ac412fde38974.tar.gz
scummvm-rg350-42ea7a97b0e562961a6c54140d5ac412fde38974.tar.bz2
scummvm-rg350-42ea7a97b0e562961a6c54140d5ac412fde38974.zip
HDB: Fire callbacks only when thier timeout is triggered
Diffstat (limited to 'engines/hdb/ai-lists.cpp')
-rw-r--r--engines/hdb/ai-lists.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp
index 0e91db4602..967d8acc1a 100644
--- a/engines/hdb/ai-lists.cpp
+++ b/engines/hdb/ai-lists.cpp
@@ -457,6 +457,10 @@ void AI::addCallback(CallbackType type, int x, int y, int delay) {
void AI::processCallbackList() {
for (int i = 0; i < kMaxCallbacks; i++)
if (_callbacks[i].type != NO_FUNCTION) {
+ if (_callbacks[i].delay) {
+ _callbacks[i].delay--;
+ return;
+ }
allCallbacks[_callbacks[i].type].function(_callbacks[i].x, _callbacks[i].y);
_callbacks[i].type = NO_FUNCTION;
_callbacks[i].x = _callbacks[i].y = 0;