Log an error when no cells are available to spawn starting units
This commit is contained in:
@@ -89,7 +89,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var mi = w.Map.Rules.Actors[s.ToLowerInvariant()].TraitInfo<MobileInfo>();
|
||||
var validCells = supportSpawnCells.Where(c => mi.CanEnterCell(w, null, c));
|
||||
if (!validCells.Any())
|
||||
throw new InvalidOperationException("No cells available to spawn starting unit {0}".F(s));
|
||||
{
|
||||
Log.Write("debug", "No cells available to spawn starting unit {0} for player {1}".F(s, p));
|
||||
continue;
|
||||
}
|
||||
|
||||
var cell = validCells.Random(w.SharedRandom);
|
||||
var subCell = mi.SharesCell ? w.ActorMap.FreeSubCell(cell) : 0;
|
||||
|
||||
Reference in New Issue
Block a user