From 23d40712c6c7af0977fe2d38751f922e30a8b3b6 Mon Sep 17 00:00:00 2001 From: uruk Date: Sat, 7 Jun 2014 19:40:29 +0200 Subject: CGE2: Refine implementation of Queue::insert(). --- engines/cge2/vga13h.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/cge2') diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index b8fe54d437..60323913a8 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -696,6 +696,9 @@ void Queue::insert(Sprite *spr, Sprite *nxt) { } void Queue::insert(Sprite *spr) { + if (locate(spr)) + return; // We only queue it if it's not already queued. + Sprite *s; for (s = _head; s; s = s->_next) if (s->_pos3D._z < spr->_pos3D._z) -- cgit v1.2.3