From a84765fc7592ae7fe7b00208842de8277fefafec Mon Sep 17 00:00:00 2001 From: leper Date: Mon, 30 Mar 2015 23:44:48 +0000 Subject: [PATCH] Add all non-structure starting entities to Unknown Nomad. Patch by elexis. Fixes #3153. This was SVN commit r16477. --- binaries/data/mods/public/maps/random/unknown_nomad.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/maps/random/unknown_nomad.js b/binaries/data/mods/public/maps/random/unknown_nomad.js index 89281e2c61..6ce78f963a 100644 --- a/binaries/data/mods/public/maps/random/unknown_nomad.js +++ b/binaries/data/mods/public/maps/random/unknown_nomad.js @@ -1318,7 +1318,7 @@ for (var i = 0; i < numPlayers; i++) } -for (var i = 0; i < numPlayers; i++) +for (var i = 0; i < numPlayers; ++i) { var id = playerIDs[i]; log("Creating units for player " + id + "..."); @@ -1328,9 +1328,13 @@ for (var i = 0; i < numPlayers; i++) var iz = playerZ[i]; var civEntities = getStartingEntities(id-1); var angle = randFloat(0, TWO_PI); - for (var j = 1; j < 4; ++j) + for (var j = 0; j < civEntities.length; ++j) { - var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1); + // TODO: Make an rmlib function to get only non-structure starting entities and loop over those + if (civEntities[j].Template.endsWith("civil_centre")) + continue; + + var count = civEntities[j].Count || 1; var jx = ix + 2 * cos(angle); var jz = iz + 2 * sin(angle); var kAngle = randFloat(0, TWO_PI);