Author: mordante
Date: Sat Apr 21 10:53:44 2007
New Revision: 16950
URL: http://svn.gna.org/viewcvs/wesnoth?rev=16950&view=rev
Log:
Applied cycholka's patch a total rewrite of the flooding code fixes bug #8942
Modified:
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/8_Frying_Pan.cfg
Modified: trunk/data/campaigns/Under_the_Burning_Suns/scenarios/8_Frying_Pan.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/8_Frying_Pan.cfg?rev=16950&r1=16949&r2=16950&view=diff
==============================================================================
--- trunk/data/campaigns/Under_the_Burning_Suns/scenarios/8_Frying_Pan.cfg
(original)
+++ trunk/data/campaigns/Under_the_Burning_Suns/scenarios/8_Frying_Pan.cfg Sat
Apr 21 10:53:44 2007
@@ -6499,6 +6499,7 @@
[event]
name=new turn
+
first_time_only=no
[if]
@@ -6550,429 +6551,63 @@
# 2. change caves adjacent to ice to shallow water
+#That step of the algorithm was bugged and otherwise completly insane
+#So completly rewritten below
+#And mercifuly short
+
[store_locations]
x=1-99
y=1-99
radius=1000
terrain=Ai
- variable=deepwater_loc
+ variable=ice_loc
[/store_locations]
-{FOREACH deepwater_loc i}
+{FOREACH ice_loc i}
[set_variable]
- name=water_x
- to_variable=deepwater_loc[$i].x
+ name=coord_x
+ to_variable=ice_loc[$i].x
[/set_variable]
[set_variable]
- name=water_y
- to_variable=deepwater_loc[$i].y
+ name=coord_y
+ to_variable=ice_loc[$i].y
[/set_variable]
# find adjacent hex with cave floor or dirt
-# test these hexes
-
-# x+0 y+1
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_y
- add=1
- [/set_variable]
[store_locations]
- x=$temp_x
- y=$temp_y
+ x=$coord_x
+ y=$coord_y
terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
+ radius=1
variable=hex_loc
[/store_locations]
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
+ {FOREACH hex_loc j}
+
+ [set_variable]
+ name=water_x
+ to_variable=hex_loc[$j].x
+ [/set_variable]
+
+ [set_variable]
+ name=water_y
+ to_variable=hex_loc[$j].y
+ [/set_variable]
+
[terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
+ letter=Ww
+ x,y=$water_x,$water_y
[/terrain]
- [/then]
- [/if]
-
-# x+1 y+0
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_x
- add=1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
-
-# x+0 y-1
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_y
- add=-1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
-
-# x-1 y+0
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_x
- add=-1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
-
-# x+1 y+1
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_x
- add=1
- [/set_variable]
-
- [set_variable]
- name=temp_y
- add=1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
-
-# x+1 y-1
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_x
- add=1
- [/set_variable]
-
- [set_variable]
- name=temp_y
- add=-1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
-
-# x-1 y+1
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_x
- add=-1
- [/set_variable]
-
- [set_variable]
- name=temp_y
- add=1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
-
-# x-1 y-1
-
- [set_variable]
- name=temp_x
- value=$water_x
- [/set_variable]
-
- [set_variable]
- name=temp_y
- value=$water_y
- [/set_variable]
-
- [set_variable]
- name=temp_x
- add=-1
- [/set_variable]
-
- [set_variable]
- name=temp_y
- add=-1
- [/set_variable]
-
- [store_locations]
- x=$temp_x
- y=$temp_y
- terrain=Uu, Re, Vu, Ce, Ke, Ch, Rr, Qxu, Uh, Uf, Ryd
- variable=hex_loc
- [/store_locations]
-
- [set_variable]
- name=temp
- value=$hex_loc.length
- [/set_variable]
-
- {CLEAR_VARIABLE hex_loc}
-
- [if]
- [variable]
- name=temp
- numerical_equals=1
- [/variable]
-
- [then]
-
- [terrain]
- letter=Ww
- x,y=$temp_x,$temp_y
- [/terrain]
-
- [/then]
- [/if]
+ {NEXT j}
{NEXT i}
-{CLEAR_VARIABLE deepwater_loc}
+{CLEAR_VARIABLE ice_loc}
# 3. change ice to deep water
@@ -7002,8 +6637,6 @@
[/terrain]
{NEXT i}
-
-{CLEAR_VARIABLE shallowwater_loc}
# 4. kill any unit in deep water, destroy any items in deep water
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits