Backed out changes to spawner and fixed Tatooine spawn TABs

This commit is contained in:
Cekis
2020-11-03 01:03:51 -05:00
parent f1048cdf5f
commit 23b461bc3f
11 changed files with 4 additions and 17 deletions

View File

@@ -2,4 +2,3 @@ strItem fltSize
s f
dune_stalker 4
dune_stalker_scavenger 4

View File

@@ -2,4 +2,3 @@ strItem fltSize
s f
canyon_krayt_dragon 4
giant_canyon_krayt_dragon 4

View File

@@ -60,23 +60,23 @@ public class spawner_area extends script.base_script
if (dataTableOpen(strFileName))
{
String[] strSpawns = dataTableGetStringColumnNoDefaults(strFileName, "strItem");
float[] fltSizes = dataTableGetFloatColumnNoDefaults(strFileName, "fltSize");
float[] fltSizes = dataTableGetFloatColumn(strFileName, "fltSize");
if (strSpawns == null || strSpawns.length == 0)
{
setName(self, "Mangled spawner. strFileName is " + strFileName + " I couldnt find any spawns in that file.");
return SCRIPT_CONTINUE;
}
if (fltSizes.length == 0)
{
setName(self, "Missing spawn sizes in " + strFileName);
return SCRIPT_CONTINUE;
}
if (fltSizes.length != strSpawns.length)
{
setName(self, "MISSING VALUES: Each spawn must have an associated size (" + strFileName + ")");
return SCRIPT_CONTINUE;
}
int intRoll = rand(0, strSpawns.length - 1);
if(intRoll >= fltSizes.length) {
intRoll = fltSizes.length - 1;
}
strSpawn = strSpawns[intRoll];
fltSize = fltSizes[intRoll];
}