From 14ed6089417422bb27e0d2ab5de1ffc33581aef5 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Mon, 23 Jul 2018 12:07:57 +0200 Subject: [PATCH] Fix variable_out_of_scope warnings in Missions --- planet/Missions.ocf/DeepSeaMining.ocs/Script.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/Script.c b/planet/Missions.ocf/DeepSeaMining.ocs/Script.c index fb766673e..63faf16d9 100644 --- a/planet/Missions.ocf/DeepSeaMining.ocs/Script.c +++ b/planet/Missions.ocf/DeepSeaMining.ocs/Script.c @@ -272,10 +272,11 @@ private func FindMainIslandPosition(int xpos, int sep, bool no_struct) if (sep == nil) sep = 250; + var x, y; for (var i = 0; i < 100; i++) { - var x = main_island_x + xpos + Random(sep*2+1)-sep; - var y = main_island_y / 2 - 220; + x = main_island_x + xpos + Random(sep*2+1)-sep; + y = main_island_y / 2 - 220; while (!GBackSolid(x, y) && y < LandscapeHeight()*3/4) y++; @@ -315,4 +316,4 @@ global func Particles_Smoke(...) p.DampingX = 800; } return p; -} \ No newline at end of file +}