Commit graph

11 commits

Author SHA1 Message Date
Charles Dang
0103959c36 Cleaned up deprecated API usage in core Lua
[ci skip]
2018-03-13 16:55:36 +11:00
vgaming
728204665c fix code problems found by luacheck (#2388)
fix code problems found by luacheck

Second iteration of the process, now handling data/lua/wml/*.lua

luacheck command used to find bugs:
  luacheck ./*.lua --globals wesnoth wml --codes --ignore 542 213
Additionally, error code 211 (unused variables) could be ignored,
as using underscore convention `_` is controversial in
wesnoth ( see https://github.com/wesnoth/wesnoth/pull/2380#discussion_r162519341 )

Actual bugs found:
* items.lua, access of global `write_name` instead of local `cfg.write_name`
* kill.lua, typo `primary_unit` -> `primary`
* bad code style: global `i` instead of local `i`
  (would conflict with 3-rd party code if it would use global `i`, too)
2018-01-23 13:35:04 -06:00
gfgtdf
121c1cb007 fix wml tags using side.controller (#1740) 2017-05-29 11:58:29 +02:00
Celtic Minstrel
3d5528f950 Proper fix for [endlevel] music issue (#1704)
(fixup 238c50)
2017-05-20 13:22:06 -04:00
Celtic Minstrel
238c175045 Probable fix for [endlevel] music issue (#1704)
In cbd3c2644, a Lua API to victory and defeat music was added, which exposes it as a vector of strings.
However, the [endlevel] implementation passed the comma-separated string directly.
This commit splits the string before passing it to the Lua API.
2017-05-16 01:58:33 -04:00
Celtic Minstrel
8d4cf3cf62 Shorten requires where possible 2017-05-03 02:42:25 -04:00
gfgtdf
cbd3c2644c add lua end_music setter/getter
this also refactors some play_controller members and moves them
to game_data

this also adds a scenario_id getter in lua.
2017-03-23 18:08:16 +01:00
gfgtdf
bd6a0c69d1 replace wesnoth.set_next_scenario() with wesnoth.game_config.next_scenario setter/getter 2017-03-20 02:48:03 +01:00
Celtic Minstrel
f4ac23a3c5 Allow [endlevel] to be used in victory or defeat events 2016-08-08 04:09:32 -04:00
Celtic Minstrel
d3374d3670 WML tags fixup 2016-04-04 20:10:52 -04:00
Celtic Minstrel
a791909544 Split the more complicated WML tags into separate Lua files 2016-04-04 17:03:38 -04:00