mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 03:53:55 +00:00
Simplify RANDOMIZE_INDEX, eliminating two temporary variables.
This commit is contained in:
parent
8dc87d7d82
commit
72af74ca4d
@ -16,10 +16,8 @@ Note: You need to use the default map settings for the scenario to work right."
|
||||
#enddef
|
||||
|
||||
#define RANDOMIZE_INDEX NUMBER
|
||||
{VARIABLE ran_max {NUMBER}}
|
||||
{VARIABLE_OP ran_max sub 1}
|
||||
{VARIABLE_OP ran_range value "0..$ran_max"}
|
||||
{VARIABLE_OP random rand $ran_range}
|
||||
{VARIABLE_OP random rand 1..{NUMBER}}
|
||||
{VARIABLE_OP random sub 1}
|
||||
#enddef
|
||||
|
||||
#define PLACE_SPAWN_GROUP X Y
|
||||
|
Loading…
x
Reference in New Issue
Block a user