From 5ef52f24503b0b00306eac59e8455727539a6c27 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Mon, 23 Jul 2018 12:08:18 +0200 Subject: [PATCH] Fix variable_out_of_scope warnings in Worlds --- planet/Worlds.ocf/GemGrabbers.ocs/Script.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/planet/Worlds.ocf/GemGrabbers.ocs/Script.c b/planet/Worlds.ocf/GemGrabbers.ocs/Script.c index 7dfde3c86..b26261fe6 100644 --- a/planet/Worlds.ocf/GemGrabbers.ocs/Script.c +++ b/planet/Worlds.ocf/GemGrabbers.ocs/Script.c @@ -334,10 +334,11 @@ private func FindMainIslandPosition(int xpos, int sep, bool no_struct) var wdt = LandscapeWidth(); var hgt = LandscapeHeight(); + var x, y; for (var i = 0; i < 100; i++) { - var x = RandomX(wdt / 2 + xpos - sep, wdt / 2 + xpos + sep); - var y = hgt / 2 - 220; + x = RandomX(wdt / 2 + xpos - sep, wdt / 2 + xpos + sep); + y = hgt / 2 - 220; while (!GBackSolid(x, y) && y < 3 * hgt / 4) y++;