From 27c2433851bf492a5f767d24cf5c2b513f646346 Mon Sep 17 00:00:00 2001 From: Andrettin Date: Tue, 24 Nov 2015 23:21:27 +0100 Subject: [PATCH] The editor now saves whether a unit's AI is active --- doc/scripts/game.html | 2 +- src/game/game.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/scripts/game.html b/doc/scripts/game.html index 7ba88e300..246f764c0 100644 --- a/doc/scripts/game.html +++ b/doc/scripts/game.html @@ -1443,7 +1443,7 @@ Besides variable names, the VariableName field takes the following altern
 --  Set mana of the unit (slot 11)
-SetUnitVariable(12, "Mana", 255)
+SetUnitVariable(11, "Mana", 255)
 
diff --git a/src/game/game.cpp b/src/game/game.cpp index b9f73ec5f..003cc47be 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -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); }