SpawnTable should initialize multiple spawns separately.

This commit is contained in:
MobiusDevelopment
2022-08-12 00:16:47 +00:00
parent a7d38cdb8d
commit 8913f24df6
3 changed files with 123 additions and 120 deletions

View File

@@ -306,6 +306,11 @@ public class SpawnTable implements IXmlReader
continue;
}
final Node countNode = attrs.getNamedItem("count");
final int count = countNode == null ? 1 : parseInteger(attrs, "count");
for (int i = 0; i < count; i++)
{
final StatSet spawnInfo = new StatSet();
spawnInfo.set("npcTemplateid", templateId);
spawnInfo.set("x", x);
@@ -320,11 +325,6 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("heading", parseInteger(attrs, "heading"));
}
if (attrs.getNamedItem("count") != null)
{
spawnInfo.set("count", parseInteger(attrs, "count"));
}
if (attrs.getNamedItem("respawnDelay") != null)
{
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
@@ -358,6 +358,7 @@ public class SpawnTable implements IXmlReader
}
}
}
}
/**
* Creates NPC spawn

View File

@@ -306,6 +306,11 @@ public class SpawnTable implements IXmlReader
continue;
}
final Node countNode = attrs.getNamedItem("count");
final int count = countNode == null ? 1 : parseInteger(attrs, "count");
for (int i = 0; i < count; i++)
{
final StatSet spawnInfo = new StatSet();
spawnInfo.set("npcTemplateid", templateId);
spawnInfo.set("x", x);
@@ -320,11 +325,6 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("heading", parseInteger(attrs, "heading"));
}
if (attrs.getNamedItem("count") != null)
{
spawnInfo.set("count", parseInteger(attrs, "count"));
}
if (attrs.getNamedItem("respawnDelay") != null)
{
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
@@ -358,6 +358,7 @@ public class SpawnTable implements IXmlReader
}
}
}
}
/**
* Creates NPC spawn

View File

@@ -306,6 +306,11 @@ public class SpawnTable implements IXmlReader
continue;
}
final Node countNode = attrs.getNamedItem("count");
final int count = countNode == null ? 1 : parseInteger(attrs, "count");
for (int i = 0; i < count; i++)
{
final StatSet spawnInfo = new StatSet();
spawnInfo.set("npcTemplateid", templateId);
spawnInfo.set("x", x);
@@ -320,11 +325,6 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("heading", parseInteger(attrs, "heading"));
}
if (attrs.getNamedItem("count") != null)
{
spawnInfo.set("count", parseInteger(attrs, "count"));
}
if (attrs.getNamedItem("respawnDelay") != null)
{
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
@@ -358,6 +358,7 @@ public class SpawnTable implements IXmlReader
}
}
}
}
/**
* Creates NPC spawn