From 01ffc2c5011a5ee80c9b0c617647b8eca1b5121c Mon Sep 17 00:00:00 2001 From: ephphatha Date: Fri, 29 Oct 2021 10:55:45 +1100 Subject: [PATCH] Use ObjectAtPosition helper in DrawObject --- Source/scrollrt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index ac0384fbf..bbaa2bb91 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -602,12 +602,12 @@ void DrawObject(const Surface &out, Point tilePosition, Point targetBufferPositi return; } - auto objectId = abs(dObject[tilePosition.x][tilePosition.y]) - 1; - if (objectId < 0) { + Object *object = ObjectAtPosition(tilePosition); + if (object == nullptr) { return; } - Object &objectToDraw = Objects[objectId]; + const Object &objectToDraw = *object; if (objectToDraw._oPreFlag != pre) { return; }