Author: zookeeper
Date: Sun Sep 21 12:21:52 2008
New Revision: 29611

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29611&view=rev
Log:
Add in a fallback orcish leader, in case the player arrived to the scenario via 
debug mode.

Modified:
    
trunk/data/campaigns/Descent_Into_Darkness/scenarios/06_Return_to_Parthyn.cfg

Modified: 
trunk/data/campaigns/Descent_Into_Darkness/scenarios/06_Return_to_Parthyn.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Descent_Into_Darkness/scenarios/06_Return_to_Parthyn.cfg?rev=29611&r1=29610&r2=29611&view=diff
==============================================================================
--- 
trunk/data/campaigns/Descent_Into_Darkness/scenarios/06_Return_to_Parthyn.cfg 
(original)
+++ 
trunk/data/campaigns/Descent_Into_Darkness/scenarios/06_Return_to_Parthyn.cfg 
Sun Sep 21 12:21:52 2008
@@ -36,10 +36,17 @@
         {GOLD 200 150 100}
     [/side]
 
+    # A fallback leader is defined for side 2 here just in case the stored unit
+    # doesn't exist for some reason, like if the player has used debug mode to
+    # jump to this scenario.
     [side]
         side=2
         controller=ai
-        no_leader=yes
+        type=Orcish Warlord
+        id=Borth
+        name=_ "Borth"
+        profile=portraits/James_Woo/orc-warlord2.png
+        canrecruit=yes
         {GOLD 120 160 200}
 #ifdef EASY
     recruit=Wolf Rider,Orcish Archer,Orcish Grunt,Troll Whelp
@@ -118,24 +125,34 @@
             [/objective]
         [/objectives]
 
-        # Place orcish leader
-        [set_variable]
-            name=orc_leader_store.x
-            value=29
-        [/set_variable]
-        [set_variable]
-            name=orc_leader_store.y
-            value=2
-        [/set_variable]
-        [set_variable]
-            name=orc_leader_store.side
-            value=2
-        [/set_variable]
-        [unstore_unit]
-            variable=orc_leader_store
-            find_vacant=no
-        [/unstore_unit]
-        {CLEAR_VARIABLE orc_leader_store}
+        # Replace the fallback orcish leader with the stored one from the
+        # previous scenario
+        [if]
+            [variable]
+                name=orc_leader_store.side
+                not_equals=$empty
+            [/variable]
+
+            [then]
+                [set_variable]
+                    name=orc_leader_store.x
+                    value=29
+                [/set_variable]
+                [set_variable]
+                    name=orc_leader_store.y
+                    value=2
+                [/set_variable]
+                [set_variable]
+                    name=orc_leader_store.side
+                    value=2
+                [/set_variable]
+                [unstore_unit]
+                    variable=orc_leader_store
+                    find_vacant=no
+                [/unstore_unit]
+                {CLEAR_VARIABLE orc_leader_store}
+            [/then]
+        [/if]
 
         # FIXME: Merge this map with the one for Saving Parthyn.
         # Scattering random trees on here would be a bad idea,


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to