From 591f593888f8b7eb23e17b77f92b0d8e1f5eb5e0 Mon Sep 17 00:00:00 2001 From: Nikolay Ambartsumov Date: Thu, 31 Dec 2020 16:48:42 +0200 Subject: [PATCH] [Blood] Fix negative priority event processing Some sprites (for example, "Blood Drip" sprite type 702) cause negative priority events to be added added to the event queue on map initialization. Despite them being the highest priority entries in the event queue, comparision with the game timer performs an implicit unsigned conversion, which wrongly results in their priority being considered much higher than the current in-game time, causing the event loop to never advance. This commit fixes this problem. --- source/blood/src/eventq.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blood/src/eventq.cpp b/source/blood/src/eventq.cpp index 992b1d69c..c4ff6b90e 100644 --- a/source/blood/src/eventq.cpp +++ b/source/blood/src/eventq.cpp @@ -557,7 +557,7 @@ void evKill(int index, int type, CALLBACK_ID cb) void evProcess(unsigned int time) { - while (queue.size() > 0 && time >= queue.begin()->priority) + while (queue.size() > 0 && (int)time >= queue.begin()->priority) { EVENT event = *queue.begin(); queue.erase(queue.begin());