mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-13 04:13:01 -04:00
Backed out changes to spawner and fixed Tatooine spawn TABs
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user