mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-04 05:16:21 -04:00
Fixed fatal static errors when buildouts disabled
This commit is contained in:
@@ -41,6 +41,7 @@ import services.spawn.MobileTemplate;
|
||||
import main.NGECore;
|
||||
import engine.clientdata.ClientFileManager;
|
||||
import engine.clientdata.visitors.PortalVisitor;
|
||||
import engine.resources.config.Config;
|
||||
import engine.resources.objects.SWGObject;
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
@@ -57,6 +58,10 @@ public class StaticService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
public void spawnStatics() {
|
||||
Config options = new Config();
|
||||
options.setFilePath("options.cfg");
|
||||
final boolean buildoutsDisabled = ((options.loadConfigFile() && options.getInt("LOAD.BUILDOUT_OBJECTS") == 0) ? true : false);
|
||||
|
||||
for (Planet planet : core.terrainService.getPlanetList()) {
|
||||
if (FileUtilities.doesFileExist("scripts/static_spawns/" + planet.getName())) {
|
||||
Path p = Paths.get("scripts/static_spawns/" + planet.getName());
|
||||
@@ -65,7 +70,13 @@ public class StaticService implements INetworkDispatch {
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||
if (file.getFileName().toString().endsWith(".py")) {
|
||||
core.scriptService.callScript("scripts/static_spawns/" + planet.getName() + "/", file.getFileName().toString().replace(".py", ""), "addPlanetSpawns", core, planet);
|
||||
try {
|
||||
core.scriptService.callScript("scripts/static_spawns/" + planet.getName() + "/", file.getFileName().toString().replace(".py", ""), "addPlanetSpawns", core, planet);
|
||||
} catch (Exception e) {
|
||||
if (!buildoutsDisabled) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FileVisitResult.CONTINUE;
|
||||
|
||||
Reference in New Issue
Block a user