From d15afd40b3bf6de59beeaa98d7896b8c2ab7878c Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Mon, 29 Jul 2019 23:34:02 +0200 Subject: Replace arr[GetLength(arr)] with arr[] --- Items.c4d/Sensors.c4d/ObjectSensor.c4d/Script.c | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Items.c4d/Sensors.c4d/ObjectSensor.c4d') diff --git a/Items.c4d/Sensors.c4d/ObjectSensor.c4d/Script.c b/Items.c4d/Sensors.c4d/ObjectSensor.c4d/Script.c index a27a398..d01245c 100644 --- a/Items.c4d/Sensors.c4d/ObjectSensor.c4d/Script.c +++ b/Items.c4d/Sensors.c4d/ObjectSensor.c4d/Script.c @@ -48,7 +48,7 @@ func SetupDetection(id id, object caller, int selection) ++menuIndex; AddMenuItem(Format("$TargetOwner$", ["$All$", "$Allied$", "$Hostile$", 0, "$DenyHostile$", "$DenyAllied$"][hostility]), "ChangeHostility", GetID(), caller, 0, caller, 0, C4MN_Add_ForceNoDesc); ++menuIndex; - + for(var part in [["$DetectDef$", detectCats], ["$DetectDenial$", denyCats]]) { for(var cat in [[C4D_Vehicle, "$Vehicle$", LORY], [C4D_Living, "$Living$", WIPF], [C4D_Object, "$Object$", ROCK]]) @@ -60,7 +60,7 @@ func SetupDetection(id id, object caller, int selection) } } } - + for(var part in [["$DetectDef$", detectIDs], ["$DetectException$", exceptIDs], ["$DetectDenial$", denyIDs]]) { for(var i = 1; i < GetLength(part[1]); ++i) @@ -109,16 +109,16 @@ func RemoveDef(id id, int indexPO, bool right) { if(denial) { - denyIDs[GetLength(denyIDs)] = part; + denyIDs[] = part; } else { - detectIDs[GetLength(detectIDs)] = part; + detectIDs[] = part; } } else { - exceptIDs[GetLength(exceptIDs)] = part; + exceptIDs[] = part; } } SetupDetection(0, selectCaller, indexPO - 1); @@ -143,15 +143,15 @@ func AddType(id id, object caller, int selection) var def = GetID(obj); if(GetIndexOf(def, defs) == -1 && GetIndexOf2([C4FO_ID, def], detectIDs) == -1 && GetIndexOf2([C4FO_ID, def], exceptIDs) == -1) { - defs[GetLength(defs)] = def; + defs[] = def; } } - + for(def in defs) { AddMenuItem(GetName(0, def), "AddDef", def, caller, 0, ++menuIndex, 0, C4MN_Add_ForceNoDesc); } - + SelectMenuItem(selection - 1, caller); SelectMenuItem(selection, caller); } @@ -174,11 +174,11 @@ func AddDef(id id, int indexPO, bool right) { if(right) { - exceptIDs[GetLength(exceptIDs)] = [C4FO_ID, id]; + exceptIDs[] = [C4FO_ID, id]; } else { - detectIDs[GetLength(detectIDs)] = [C4FO_ID, id]; + detectIDs[] = [C4FO_ID, id]; } AddType(0, selectCaller, indexPO - 1); } @@ -246,24 +246,24 @@ func Check(bool retrigger) var hostilityDenyCond = [0, Find_Hostile(GetOwner(this)), Find_Not(Find_Hostile(GetOwner(this)))][hostility - 3]; if(GetLength(exceptIDs) > 1) { - additionalConds[GetLength(additionalConds)] = Find_Not(exceptIDs); + additionalConds[] = Find_Not(exceptIDs); } if(hostilityCond) { - additionalConds[GetLength(additionalConds)] = hostilityCond; + additionalConds[] = hostilityCond; } var additionalDenyConds = [C4FO_Or]; if(denyIDs) { - additionalDenyConds[GetLength(additionalDenyConds)] = denyIDs; + additionalDenyConds[] = denyIDs; } if(denyCats) { - additionalDenyConds[GetLength(additionalDenyConds)] = Find_Category(denyCats); + additionalDenyConds[] = Find_Category(denyCats); } if(hostilityDenyCond) { - additionalDenyConds[GetLength(additionalDenyConds)] = Find_And(Find_Or(detectIDs, detectCats && Find_Category(detectCats)), hostilityDenyCond); + additionalDenyConds[] = Find_And(Find_Or(detectIDs, detectCats && Find_Category(detectCats)), hostilityDenyCond); } ClearParticles("PSpark", this); if(GetLength(additionalDenyConds) > 1 && (obj = FindObject2(Find_Exclude(this), posCond, Find_NoContainer(), Find_Category(C4D_Living | C4D_Object | C4D_Vehicle), IgnoreSensorIgnored(), additionalDenyConds))) -- cgit v1.2.3-54-g00ecf