forked from Mirrors/openclonk
Fix some implicit for loop declaration errors
parent
7f543e8390
commit
342916a1ed
|
@ -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;
|
||||
|
|
|
@ -44,7 +44,7 @@ public func SetSpawnObject(id def)
|
|||
public func Reset(plr)
|
||||
{
|
||||
if (!GetType(plr)) plr = GetPlayers(); else plr = [plr];
|
||||
for (p in plr)
|
||||
for (var p in plr)
|
||||
{
|
||||
spawn_list[p] = nil;
|
||||
UpdateVisibility(p);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue