Index: ps/trunk/binaries/data/mods/public/simulation/helpers/Player.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/helpers/Player.js +++ ps/trunk/binaries/data/mods/public/simulation/helpers/Player.js @@ -16,7 +16,9 @@ settings = {}; // Add gaia to simplify iteration - if (settings.PlayerData && settings.PlayerData[0]) + // (if gaia is not already the first civ such as when called from Atlas' ActorViewer) + if (settings.PlayerData && settings.PlayerData[0] && + (!settings.PlayerData[0].Civ || settings.PlayerData[0].Civ != "gaia")) settings.PlayerData.unshift(null); var playerData = settings.PlayerData; Index: ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp =================================================================== --- ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp +++ ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2018 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -287,10 +287,14 @@ debug_warn(L"Failed to load whiteness texture"); } - // Start the simulation + // Prepare the simulation m.Simulation2.LoadDefaultScripts(); m.Simulation2.ResetState(); + // Set player data + m.Simulation2.SetMapSettings(m.Simulation2.GetPlayerDefaults()); + m.Simulation2.LoadPlayerSettings(true); + // Tell the simulation we've already loaded the terrain CmpPtr cmpTerrain(m.Simulation2, SYSTEM_ENTITY); if (cmpTerrain) @@ -300,6 +304,8 @@ CmpPtr cmpRangeManager(m.Simulation2, SYSTEM_ENTITY); if (cmpRangeManager) cmpRangeManager->SetLosRevealAll(-1, true); + + m.Simulation2.InitGame(); } ActorViewer::~ActorViewer()