summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DTCompatibility.c2
-rw-r--r--DTContents.c2
-rw-r--r--DTObjectSerializing.c14
-rw-r--r--DTPlayers.c10
-rw-r--r--DTTemplateFunctions.c10
-rw-r--r--DTTransform.c6
-rw-r--r--DTUtility.c11
7 files changed, 26 insertions, 29 deletions
diff --git a/DTCompatibility.c b/DTCompatibility.c
index d3ae922..1246ee6 100644
--- a/DTCompatibility.c
+++ b/DTCompatibility.c
@@ -12,7 +12,7 @@ global func RequestHostFeature(string feature) { if(!HaveHostFeature(feature) ||
global func AnnounceHostFeature(string feature)
{
hostFeatures || (hostFeatures = []);
- hostFeatures[GetLength(hostFeatures)] = feature;
+ hostFeatures[] = feature;
}
global func HaveHostFeature(string feature)
diff --git a/DTContents.c b/DTContents.c
index cb49691..9097fed 100644
--- a/DTContents.c
+++ b/DTContents.c
@@ -6,7 +6,7 @@ global func GetContents(bool recursive, object obj)
var ret = [];
for(var i = 0; i < obj->ContentsCount(); ++i)
{
- ret[GetLength(ret)] = obj->Contents(i);
+ ret[] = obj->Contents(i);
if(recursive)
{
ArrayAppendArray(ret, obj->Contents(i)->GetContents(true));
diff --git a/DTObjectSerializing.c b/DTObjectSerializing.c
index 8633f8c..e3b6de0 100644
--- a/DTObjectSerializing.c
+++ b/DTObjectSerializing.c
@@ -161,7 +161,7 @@ global func GetObjectSaveData(object obj)
var cnt = GetComponent(componentID, 0, 0, id);
if(cnt != 0)
{
- defComponents[GetLength(defComponents)] = [componentID, cnt];
+ defComponents[] = [componentID, cnt];
}
}
for(var i = 0, componentID; componentID = GetComponent(0, i, obj); ++i)
@@ -169,7 +169,7 @@ global func GetObjectSaveData(object obj)
var cnt = GetComponent(componentID, 0, obj);
if(cnt != 0)
{
- objComponents[GetLength(objComponents)] = [componentID, cnt];
+ objComponents[] = [componentID, cnt];
}
}
@@ -190,7 +190,7 @@ global func GetObjectSaveData(object obj)
if(cnt != defCnt)
{
- diffComponents[GetLength(diffComponents)] = [defID, cnt];
+ diffComponents[] = [defID, cnt];
}
}
ArrayAppendArray(diffComponents, objComponents);
@@ -203,7 +203,7 @@ global func GetObjectSaveData(object obj)
var contents = [];
for(var content in obj->GetContents())
{
- contents[GetLength(contents)] = GetObjectSaveData(content);
+ contents[] = GetObjectSaveData(content);
}
ret[Object_Contents] = contents;
ret[Object_PlrViewRange] = GetObjectVal("PlrViewRange", 0, obj);
@@ -222,7 +222,7 @@ global func GetObjectSaveData(object obj)
for(var i = 0; i < cnt; ++i)
{
var name = GetLocalByIndex(i, obj, f);
- locals[GetLength(locals)] = [name, LocalX(name, obj)];
+ locals[] = [name, LocalX(name, obj)];
}
}
@@ -233,7 +233,7 @@ global func GetObjectSaveData(object obj)
while((offset = obj->GetOverlayValueByIndex(diffIndex, offset)) >= 0)
{
var overlayID = obj->GetOverlayValueByIndex(0, offset, 1);
- overlays[GetLength(overlays)] = [obj->GetOverlayValueByIndex(0, offset, 4), obj->GetOverlayValueByIndex(0, offset, 3), overlayID, obj->GetOverlayValueByIndex(0, offset, 2), obj->GetOverlayValueByIndex(0, offset, 5), obj->GetOverlayValueByIndex(0, offset, 6), Object(obj->GetOverlayValueByIndex(0, offset, 8)), obj->GetObjDrawTransform(-1, offset), GetClrModulation(obj, overlayID)];
+ overlays[] = [obj->GetOverlayValueByIndex(0, offset, 4), obj->GetOverlayValueByIndex(0, offset, 3), overlayID, obj->GetOverlayValueByIndex(0, offset, 2), obj->GetOverlayValueByIndex(0, offset, 5), obj->GetOverlayValueByIndex(0, offset, 6), Object(obj->GetOverlayValueByIndex(0, offset, 8)), obj->GetObjDrawTransform(-1, offset), GetClrModulation(obj, overlayID)];
diffIndex = 1;
}
if(GetActMapVal("FlipDir", action, id) && GetDir(obj) == DIR_Right)
@@ -248,7 +248,7 @@ global func GetObjectSaveData(object obj)
var value = GetPhysical(physical, PHYS_Current, obj);
if(value != GetPhysical(physical, 0, 0, id))
{
- physicals[GetLength(physicals)] = [physical, value];
+ physicals[] = [physical, value];
}
}
if(GetLength(physicals) != 0)
diff --git a/DTPlayers.c b/DTPlayers.c
index 5a688e6..90ba85b 100644
--- a/DTPlayers.c
+++ b/DTPlayers.c
@@ -24,10 +24,10 @@ global func GetPlayers(int team, bool exclude)
plrInfo[Player_Color] = GetPlrColorDw(plr);
plrInfo[Player_Team] = GetPlayerTeam(plr);
plrInfo[Player_Type] = GetPlayerType(plr);
- ret[GetLength(ret)] = plrInfo;
+ ret[] = plrInfo;
}
}
-
+
return ret;
}
@@ -38,7 +38,7 @@ global func GetPlayerNumbers(int team, bool exclude)
{
if(!team || (team == GetPlayerTeam(plr)) != exclude)
{
- ret[GetLength(ret)] = plr;
+ ret[] = plr;
}
}
return ret;
@@ -66,7 +66,7 @@ global func GetTeams()
teamInfo[Team_TaggedName] = GetTaggedTeamName();
teamInfo[Team_Color] = GetTeamColor(team);
teamInfo[Team_Players] = GetPlayers(team);
- ret[GetLength(ret)] = teamInfo;
+ ret[] = teamInfo;
}
return ret;
}
@@ -76,7 +76,7 @@ global func GetTeamIDs()
var ret = [];
for(var team, i = 0; (i < GetTeamCount()) && ((team = GetTeamByIndex(i)) || true); ++i)
{
- ret[GetLength(ret)] = team;;
+ ret[] = team;;
}
return ret;
} \ No newline at end of file
diff --git a/DTTemplateFunctions.c b/DTTemplateFunctions.c
index e494766..8148499 100644
--- a/DTTemplateFunctions.c
+++ b/DTTemplateFunctions.c
@@ -35,7 +35,7 @@ global func SetFunction(string name, array function)
}
else
{
- TMPL_Funcs[GetLength(TMPL_Funcs)] = function;
+ TMPL_Funcs[] = function;
}
}
@@ -95,7 +95,7 @@ global func Function(arguments, commands)
}
else
{
- funcContent[GetLength(funcContent)] = [index, escapeCount];
+ funcContent[] = [index, escapeCount];
argument = "";
escapeCount = 0;
}
@@ -110,7 +110,7 @@ global func Function(arguments, commands)
{
if(contentPart != "")
{
- funcContent[GetLength(funcContent)] = contentPart;
+ funcContent[] = contentPart;
contentPart = "";
}
@@ -134,8 +134,8 @@ global func Function(arguments, commands)
}
}
if(isArg) FatalError(Format("Function: argument-reference \"%s\" not closed.", argument));
- else if(contentPart) funcContent[GetLength(funcContent)] = contentPart;
- funcContents[GetLength(funcContents)] = funcContent;
+ else if(contentPart) funcContent[] = contentPart;
+ funcContents[] = funcContent;
}
return [arguments, funcContents];
diff --git a/DTTransform.c b/DTTransform.c
index d155827..2a87d3d 100644
--- a/DTTransform.c
+++ b/DTTransform.c
@@ -40,7 +40,7 @@ global func TransformOverlays(overlays)
overlays = Abs(overlays);
for(var i = 0; i <= overlays; ++i)
{
- ret[GetLength(ret)] = i;
+ ret[] = i;
}
return ret;
}
@@ -67,12 +67,12 @@ global func TransformOverlays(overlays)
overlay = Abs(overlay);
for(var j = last + 1; j <= overlay; ++j)
{
- ret[GetLength(ret)] = j;
+ ret[] = j;
}
}
else
{
- ret[GetLength(ret)] = overlay;
+ ret[] = overlay;
}
last = overlay;
}
diff --git a/DTUtility.c b/DTUtility.c
index 5bf7ee9..19561ec 100644
--- a/DTUtility.c
+++ b/DTUtility.c
@@ -128,7 +128,7 @@ global func MultiStringLowercase(array strings)
var ret = [];
for(var string in strings)
{
- ret[GetLength(ret)] = StringLowercase(string);
+ ret[] = StringLowercase(string);
}
return ret;
}
@@ -239,7 +239,7 @@ global func StringReplaceMulti(string find, string string, array replace)
var ret = [];
for(var rep in replace)
{
- ret[GetLength(ret)] = StringReplace(find, string, rep);
+ ret[] = StringReplace(find, string, rep);
}
return ret;
}
@@ -287,7 +287,7 @@ global func GetIDsByName(string name, int category) // WARNING: desyncs between
{
if(GetName(0, id) == name)
{
- ret[GetLength(ret)] = id;
+ ret[] = id;
}
}
return ret;
@@ -298,10 +298,7 @@ global func ArrayConcatenate(array arrays)
var ret = [];
for(var arr in arrays)
{
- for(var val in arr)
- {
- ret[GetLength(ret)] = val;
- }
+ ArrayAppendArray(ret, arr);
}
return ret;
}