Skip to content

Commit

Permalink
move most dark forecast code to lua
Browse files Browse the repository at this point in the history
This has multiple advantages:
1) It makes the code easier to understand because we now can use local
variables and return values.
2) It makes the code easier to debug because we don't have to reload the
wml cache anymore for changes to have an effect
3) It makes loading the multiplayer wml faster, specially dark forecasts
wml codes is now so short that we don't need to guard it inside its own
preprocessor marco anymore.
4) It decreases the save file size.

This commit also does other improvements to the code, for example:
1) We don't create temporary units anymore just to query the costs of
a unittype.
2) We now load the weather maps dynamically at runtime with
wesnoth.read_file, this decreased the prorocessor paring time and savefile
size further.
3) When creating the new spawns we use temporary objects to decrease
the units movement, instead of changing and resetting the unit stats
manually.

This also has a disadvantage:
1) It now requires all players to have this scenario installed, since it
it a mainline scenario i see no problems with that.
  • Loading branch information
gfgtdf committed Feb 18, 2016
1 parent 6623641 commit 8ee34c3
Show file tree
Hide file tree
Showing 2 changed files with 539 additions and 1,159 deletions.

0 comments on commit 8ee34c3

Please sign in to comment.