From 342916a1ed9c72d75a63312e36b07fb7ea5f67de Mon Sep 17 00:00:00 2001 From: Sven Eberhardt Date: Mon, 24 Oct 2016 21:01:41 -0400 Subject: [PATCH] Fix some implicit for loop declaration errors --- planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c | 2 +- .../Objects.ocd/Environment.ocd/ItemSpawn.ocd/Script.c | 10 +++++----- planet/Objects.ocd/Helpers.ocd/UserAction.ocd/Script.c | 6 +++--- .../Ropebridge.ocd/BridgeSegment.ocd/Script.c | 2 +- .../Structures.ocd/Structure.ocd/Script.c | 2 +- planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c | 2 +- planet/System.ocg/Array.c | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c b/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c index 7ed073701..b56bb3134 100644 --- a/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c +++ b/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c @@ -219,7 +219,7 @@ public func ReplaceAction(string action, byaction) if(old[0] == byaction[0] && old[1] == byaction[1]) { var i = 0; - for (test in ActualReplace) + for (var test in ActualReplace) { if(test && test[0] == action) break; diff --git a/planet/Objects.ocd/Environment.ocd/ItemSpawn.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/ItemSpawn.ocd/Script.c index 43b789f45..0597f597a 100644 --- a/planet/Objects.ocd/Environment.ocd/ItemSpawn.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/ItemSpawn.ocd/Script.c @@ -44,11 +44,11 @@ public func SetSpawnObject(id def) public func Reset(plr) { if (!GetType(plr)) plr = GetPlayers(); else plr = [plr]; - for (p in plr) - { - spawn_list[p] = nil; - UpdateVisibility(p); - } + for (var p in plr) + { + spawn_list[p] = nil; + UpdateVisibility(p); + } return true; } diff --git a/planet/Objects.ocd/Helpers.ocd/UserAction.ocd/Script.c b/planet/Objects.ocd/Helpers.ocd/UserAction.ocd/Script.c index 81c11f42d..5bb7b161a 100644 --- a/planet/Objects.ocd/Helpers.ocd/UserAction.ocd/Script.c +++ b/planet/Objects.ocd/Helpers.ocd/UserAction.ocd/Script.c @@ -557,7 +557,7 @@ public func AddEvaluator(string eval_type, string group, name, string help, stri } // Copy any object evaluators to existing evaluator lists if (eval_type == "Object" && object_evaluators) - for (obj_eval in object_evaluators) + for (var obj_eval in object_evaluators) obj_eval.Options[GetLength(obj_eval.Options)] = action_def; return action_def; } @@ -786,7 +786,7 @@ private func EvalBool_Not(proplist props, proplist context) { return !EvaluateVa private func EvalBool_And(proplist props, proplist context) { - for (cond in props.Operands) + for (var cond in props.Operands) if (!EvaluateValue("Boolean", cond, context)) return false; return true; @@ -794,7 +794,7 @@ private func EvalBool_And(proplist props, proplist context) private func EvalBool_Or(proplist props, proplist context) { - for (cond in props.Operands) + for (var cond in props.Operands) if (EvaluateValue("Boolean", cond, context)) return true; return false; diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Ropebridge.ocd/BridgeSegment.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Ropebridge.ocd/BridgeSegment.ocd/Script.c index 3b3c31a28..bc806b8dd 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Ropebridge.ocd/BridgeSegment.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Ropebridge.ocd/BridgeSegment.ocd/Script.c @@ -66,7 +66,7 @@ public func GetLoadWeight() if (!has_plank) return 10; var weight = 50; - for (obj in FindObjects(Find_AtRect(-3, -10, 6, 10), Find_Exclude(this), Find_NoContainer())) + for (var obj in FindObjects(Find_AtRect(-3, -10, 6, 10), Find_Exclude(this), Find_NoContainer())) if (obj->GetID() != Ropebridge_Segment && obj->GetID() != Ropebridge_Post && obj->GetID() != BridgePlank) if (obj->GetContact(-1, 8)) weight += obj->GetMass(); diff --git a/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Structure.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Structure.ocd/Script.c index 731ce2d89..6bdddd67b 100644 --- a/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Structure.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Structure.ocd/Script.c @@ -65,7 +65,7 @@ public func Damage(int change, int cause, int cause_plr) private func EjectContentsOnDestruction(int cause, int by_player) { // Exit all objects in this structure. - for (obj in FindObjects(Find_Container(this))) + for (var obj in FindObjects(Find_Container(this))) { // For a non-blast destruction just place the objects at the bottom of the structure. var angle = Random(360); diff --git a/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c index 5aa7e96fa..0ebc3ce53 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c @@ -247,7 +247,7 @@ protected func Damage(int change, int cause, int by_player) if (!Contained()) { // First eject the contents in different directions. - for (obj in FindObjects(Find_Container(this))) + for (var obj in FindObjects(Find_Container(this))) { var speed = RandomX(3, 5); var angle = Random(360); diff --git a/planet/System.ocg/Array.c b/planet/System.ocg/Array.c index f99b725a2..148023213 100644 --- a/planet/System.ocg/Array.c +++ b/planet/System.ocg/Array.c @@ -200,7 +200,7 @@ global func MoveArrayItems(array arr, array source_indices, int insert_before) source_indices = source_indices[:]; SortArray(source_indices); } - for (idx in source_indices) + for (var idx in source_indices) { if (idx < 0) idx += (1-(idx+1)/len)*len; // resolve negative indices if (idx >= len) continue; @@ -229,7 +229,7 @@ global func RemoveArrayIndices(array arr, array indices) { indices = indices[:]; SortArray(indices, true); - for (idx in indices) + for (var idx in indices) if (idx < GetLength(arr)) RemoveArrayIndex(arr, idx); return true;