From e4b434b2ef9d7ebb46e6686aeb0c27c9a96d963c Mon Sep 17 00:00:00 2001 From: ephphatha Date: Wed, 9 Jun 2021 23:48:32 +1000 Subject: [PATCH] Refactor SetupObject to use Point --- Source/objects.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/objects.cpp b/Source/objects.cpp index 2bc0fe859..d0798370f 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -1206,11 +1206,11 @@ void DeleteObject(int oi, int i) ActiveObjects[i] = ActiveObjects[ActiveObjectCount]; } -void SetupObject(int i, int x, int y, _object_id ot) +void SetupObject(int i, Point position, _object_id ot) { Objects[i]._otype = ot; object_graphic_id ofi = AllObjects[ot].ofindex; - Objects[i].position = { x, y }; + Objects[i].position = position; const auto &found = std::find(std::begin(ObjFileList), std::end(ObjFileList), ofi); if (found == std::end(ObjFileList)) { @@ -1613,7 +1613,7 @@ void AddCryptBook(_object_id ot, int v2, int ox, int oy) AvailableObjects[0] = AvailableObjects[MAXOBJECTS - 1 - ActiveObjectCount]; ActiveObjects[ActiveObjectCount] = oi; dObject[ox][oy] = oi + 1; - SetupObject(oi, ox, oy, ot); + SetupObject(oi, { ox, oy }, ot); AddCryptObject(oi, v2); ActiveObjectCount++; } @@ -1704,7 +1704,7 @@ void AddObject(_object_id ot, int ox, int oy) AvailableObjects[0] = AvailableObjects[MAXOBJECTS - 1 - ActiveObjectCount]; ActiveObjects[ActiveObjectCount] = oi; dObject[ox][oy] = oi + 1; - SetupObject(oi, ox, oy, ot); + SetupObject(oi, { ox, oy }, ot); switch (ot) { case OBJ_L1LIGHT: case OBJ_SKFIRE: