1
0
forked from 0ad/0ad

Fix mapgeneration of ambush & frontier in atlas

56f15f0869 broke those maps in atlas where g_MapSettings.TeamPlacement
is never initialized.

Bug found by @elexis
Fix not objected by @elexis (comments: committable if 56f15f0869 should
not be reverted and developer time is limited)

Differential revision: https://code.wildfiregames.com/D5200
This was SVN commit r27952.
This commit is contained in:
marder 2023-11-21 21:44:31 +00:00
parent 62ab340622
commit 63a4799f56
2 changed files with 5 additions and 3 deletions

View File

@ -20,15 +20,16 @@ Engine.SetProgress(10);
if (!isNomad())
{
let pattern = g_MapSettings.TeamPlacement || pickRandom(["line", "radial", "randomGroup", "stronghold"]);
var [playerIDs, playerPosition] =
createBases(
...playerPlacementByPattern(
g_MapSettings.TeamPlacement,
pattern,
fractionToTiles(randFloat(0.2, 0.35)),
fractionToTiles(randFloat(0.08, 0.1)),
randomAngle(),
undefined),
g_PlayerbaseTypes[g_MapSettings.TeamPlacement].walls);
g_PlayerbaseTypes[pattern].walls);
markPlayerAvoidanceArea(playerPosition, defaultPlayerBaseRadius());
}

View File

@ -21,7 +21,8 @@ Engine.SetProgress(20);
if (!isNomad())
{
let pattern = g_MapSettings.TeamPlacement;
// Note: `|| pickRandom(...)` is needed for atlas.
let pattern = g_MapSettings.TeamPlacement || pickRandom(["line", "radial", "randomGroup", "stronghold"]);
createBases(
...playerPlacementByPattern(
pattern,