SotA S2: Fix exploit allowing WCs to be created on invalid hexes
The leader should be able to raise corpses only on adjacent hexes. However, it was possible for the player to right-click on an adjacent hex then quickly right-click on any other hex, and the corpse would be raised there instead. Allowing user interaction to affect a command while it is being executed may be unintended behavior, and if the engine is changed to prevent it, this commit can be reverted.
This commit is contained in:
parent
9dfd065e14
commit
de0159e120
1 changed files with 16 additions and 3 deletions
|
@ -161,8 +161,18 @@ I decided to hide in the cemetery. That way I could try my experiment to animate
|
|||
side=1
|
||||
amount=-{GOLD}
|
||||
[/gold]
|
||||
# x1 and y1 have to be stored because they can be changed by the
|
||||
# player right-clicking again during this command:
|
||||
[set_variable]
|
||||
name=zombie_x
|
||||
value=$x1
|
||||
[/set_variable]
|
||||
[set_variable]
|
||||
name=zombie_y
|
||||
value=$y1
|
||||
[/set_variable]
|
||||
[item] # Marks the grave as used.
|
||||
x,y=$x1,$y1
|
||||
x,y=$zombie_x,$zombie_y
|
||||
image=items/dirt.png
|
||||
[/item]
|
||||
[delay] # This makes it a bit animated.
|
||||
|
@ -170,7 +180,7 @@ I decided to hide in the cemetery. That way I could try my experiment to animate
|
|||
[/delay]
|
||||
[unit]
|
||||
side=1
|
||||
x,y=$x1,$y1
|
||||
x,y=$zombie_x,$zombie_y
|
||||
type={UNIT}
|
||||
animate=yes
|
||||
moves=0
|
||||
|
@ -181,11 +191,14 @@ I decided to hide in the cemetery. That way I could try my experiment to animate
|
|||
[terrain]
|
||||
terrain=''
|
||||
layer=overlay
|
||||
x,y=$x1,$y1
|
||||
x,y=$zombie_x,$zombie_y
|
||||
[/terrain]
|
||||
[fire_event]
|
||||
id=more_guards
|
||||
[/fire_event]
|
||||
[clear_variable]
|
||||
name=zombie_x,zombie_y
|
||||
[/clear_variable]
|
||||
[/else]
|
||||
[/if]
|
||||
[/command]
|
||||
|
|
Loading…
Add table
Reference in a new issue