1
0
forked from 0ad/0ad

Prevent selecting unusable civs in random map setup. Fixes #813.

This was SVN commit r9392.
This commit is contained in:
Ykkrosh 2011-05-02 15:26:38 +00:00
parent 7499b23991
commit 0b996bbe75
4 changed files with 15 additions and 8 deletions

View File

@ -73,5 +73,6 @@
], ],
"StartEntities": "StartEntities":
[ [
] ],
} "SelectableInGameSetup": false
}

View File

@ -82,5 +82,6 @@
], ],
"StartEntities": "StartEntities":
[ [
] ],
} "SelectableInGameSetup": false
}

View File

@ -86,5 +86,6 @@
], ],
"StartEntities": "StartEntities":
[ [
] ],
} "SelectableInGameSetup": false
}

View File

@ -387,8 +387,12 @@ function initCivNameList()
// Cache civ data // Cache civ data
g_CivData = loadCivData(); g_CivData = loadCivData();
var civList = [ { "name": civ.Name, "code": civ.Code } for each (civ in g_CivData) ]; // Extract name/code, and skip civs that are explicitly disabled
// (intended for unusable incomplete civs)
var civList = [ { "name": civ.Name, "code": civ.Code }
for each (civ in g_CivData)
if (civ.SelectableInGameSetup !== false) ];
// Alphabetically sort the list, ignoring case // Alphabetically sort the list, ignoring case
civList.sort(sortNameIgnoreCase); civList.sort(sortNameIgnoreCase);