The editor now saves whether a unit's AI is active

This commit is contained in:
Andrettin 2015-11-24 23:21:27 +01:00
parent dc4391b8c3
commit 27c2433851
2 changed files with 4 additions and 1 deletions

View file

@ -1443,7 +1443,7 @@ Besides variable names, the <i>VariableName</i> field takes the following altern
<pre>
-- Set mana of the unit (slot 11)
SetUnitVariable(12, "Mana", 255)
SetUnitVariable(11, "Mana", 255)
</pre>
<a name="SharedVision"></a>

View file

@ -522,6 +522,9 @@ int WriteMapSetup(const char *mapSetup, CMap &map, int writeTerrain)
if (unit.Type->GivesResource) {
f->printf("SetResourcesHeld(unit, %d)\n", unit.ResourcesHeld);
}
if (!unit.Active) { //Active is true by default
f->printf("SetUnitVariable(unit, \"Active\", false)\n");
}
if (unit.Type->Teleporter && unit.Goal) {
teleporters.push_back(*it);
}