From 70ad0003e16e748cd641a765ebb2507f559130eb Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 2 Aug 2020 20:43:50 -0700 Subject: [PATCH] Initialize bx1/by1/bx2/by2 in custom entity creation When I compile in release mode, GCC complains that these variables MAY be uninitialized when it comes time to create the moving platform entity. I can't think of any way that it could be uninitialized and testing my release build seemed to be fine, but I'm initializing these variables just to be sure. --- desktop_version/src/Map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index 8fdab98b..ec2ea322 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -1721,7 +1721,7 @@ void mapclass::loadlevel(int rx, int ry) const int ey = (ent.y % 30) * 8; // Platform and enemy bounding boxes - int bx1, by1, bx2, by2; + int bx1 = 0, by1 = 0, bx2 = 0, by2 = 0; if (ent.t == 1 || (ent.t == 2 && ent.p1 <= 4)) {