Commit graph

717 commits

Author SHA1 Message Date
Celtic Minstrel
840b6e70be Fix [modify_side]reset_maps=true
I have no idea how this was missed...
2021-02-22 21:26:30 -05:00
Celtic Minstrel
2271de81b7 Promote deprecation warning for [option]message= to level 3
Addresses #3980
2021-02-22 21:26:05 -05:00
Charles Dang
dd0b073c05 Simplify a few wesnoth.*_unit calls
[ci skip]
2019-10-15 20:21:22 +11:00
josteph
3bc8972f1d Lua: Fix wesnoth.deprecate_api for the case of deprecating a table that had a metamethod other than __index/__newindex
(cherry picked from commit 21823d9332)
2019-09-26 12:23:23 +00:00
josteph
256838796b lua: Fix a bug when calling wesnoth.deprecate_api on a table that had a metatable.
The old metatable was used as the metatable of the new element's
metatable, which doesn't make any sense at all.

Fixes #4079

(cherry picked from commit 56131f14c4)
2019-09-26 12:23:23 +00:00
newfrenchy83
698066d2d1 [heal_unit]: clear the animation after playing it (#3526)
Fixes another case of unit halo remaining after death.
2018-09-07 19:38:41 +03:00
Jyrki Vesterinen
4666ae8c23 [animate_unit]: clear the animation after playing it
This avoids a reference to the unit from being leaked, which prevented the
unit's halo (if any) from disappearing when the unit died.

Fixes #3509. Closes #3520.
2018-09-06 20:14:16 +03:00
josteph
167d56519e WML: Don't add a \n before condition=lose objectives if there are no objectives listed before them. 2018-07-04 20:15:59 -04:00
Andras Szell
cc04bc764a Fix: add redraw to narrator's message so village count is refreshed
Fixes: https://forums.wesnoth.org/viewtopic.php?f=21&t=48370

In the tutorial when we occupy the first village the message tells us the
village count got incremented, but in the old version it was incremented
only afterwards. Non-narrator messages were updated properly. By adding the
redraw, narrator messages triggered by capture event produce the same
result as other speakers.
2018-06-26 18:44:08 +11:00
Iris Morelle
a2963dcdbc Fix Lua errors when failing to set a music track on an empty playlist
Closes #3194.
2018-06-09 18:54:06 -04:00
Iris Morelle
1b7557a2ca Fall back to the unit type name for [message] captions for nameless units
Fixes #3211.
2018-06-05 04:44:23 -04:00
Iris Morelle
79812a853e Don't allow [kill] animate=yes to scroll to units through fog and shroud
Restores 1.12's behaviour.
2018-06-04 16:15:30 -04:00
Iris Morelle
d2e94b320f Do not allow [message] to scroll to units through fog/shroud
This was a regression from 1.12.
2018-05-21 23:23:00 -04:00
Iris Morelle
a58712a539 Fix [change_theme] crashing when theme= isn't specified
Leaving theme= unspecified ought to have the same effect as providing it
and setting it to an empty string. Without the check for a nil value,
however, it would result in a crash like this:

  20180519 22:31:54 error scripting/lua: lua/wml-tags.lua:922: bad argument #3 to '__newindex' (string expected, got nil)
  stack traceback:
          [C]: in metamethod '__newindex'
          lua/wml-tags.lua:922: in local 'cmd'
          lua/wml-utils.lua:145: in field 'handle_event_commands'
          lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
2018-05-19 22:37:05 -04:00
mattsc
2f611a9c2e
Merge pull request #3079 from mattsc/lua_deprecation_fixes
Replace deprecated Lua code
2018-05-13 16:57:17 -07:00
mattsc
0978779616 Lua random map generator: fix off-by-one error in flip transforms
Among other things, this gave HttT S17 (Sceptre of Fire) a 50% chance
of crashing at scenario start.
2018-05-12 18:38:35 -07:00
mattsc
acf4269f6a Lua code: replace deprecated wesnoth.get_all_vars() calls 2018-05-12 17:41:37 -07:00
mattsc
51b2dbec19 Lua code: replace deprecated wesnoth.set_variable() calls 2018-05-12 17:41:28 -07:00
mattsc
bf711024ff Prevent definition of wml.variables to cause deprecation warnings 2018-05-10 19:55:32 -07:00
mattsc
2922b19802 Lua code: replace deprecated wesnoth.get_variable() calls 2018-05-10 19:55:31 -07:00
mattsc
32170543fd Lua code: replace deprecated wesnoth.tovconfig() calls 2018-05-10 19:54:59 -07:00
Jyrki Vesterinen
77b9bc3969 [heal_unit]: ensure that heal amount is an integer 2018-04-16 20:52:17 +03:00
gfgtdf
56cf77e3a0
fix [message] side_for= not working for the last side.
fixes #2776
2018-04-04 18:21:56 +02:00
Celtic Minstrel
2492585ee2
Fix incorrect error message when encountering an unknown persistent tag 2018-04-01 14:01:50 -04:00
Celtic Minstrel
cfceec1d58
Fix unintended change to the semantics of [modify_side]income= 2018-03-30 11:05:58 -04:00
Celtic Minstrel
5008c72a22
Fixup wml.all_variables 2018-03-18 01:38:39 -04:00
Celtic Minstrel
8d74b72031 fixup! Fix missing return in on_event() 2018-03-17 17:21:20 -04:00
Celtic Minstrel
a314876bf2 Use new persistent tags interface for [object] [objectives] [item] 2018-03-17 17:16:23 -04:00
Celtic Minstrel
ddcbb4cb50 Add a more convenient way of registering custom saved game data 2018-03-17 17:16:22 -04:00
Celtic Minstrel
68d545c3be Add a couple more WML utility functions 2018-03-17 16:48:06 -04:00
Celtic Minstrel
d4e08359dd Fix missing return in on_event() 2018-03-17 16:48:04 -04:00
Celtic Minstrel
e776635023 Clear up redundancies in helper compatibility and deprecate the array functions 2018-03-17 16:48:03 -04:00
Celtic Minstrel
4b08a40181 Deprecate wesnoth.set_music 2018-03-17 16:48:02 -04:00
Celtic Minstrel
6e4d09d2a5 Bump up a couple of deprecation levels at @vultraz's request 2018-03-17 16:48:01 -04:00
Celtic Minstrel
08ec9017b5 Lua API: Some tweaks of the experimental wml module 2018-03-17 16:48:00 -04:00
Celtic Minstrel
23aac4f72f Cleanup of fef953a48e
- Fix the rabbit AI
- Enable invoke_synced_command to also call (some) built-in commands
  and give an error message in the case of an unknown command
- Remove some unnecessary implementation details
2018-03-17 16:48:00 -04:00
Charles Dang
134353f863 Further cleanup of deprecated Lua API usecases (inc. ones from fef953a)
[ci skip]
2018-03-17 00:41:32 +11:00
gfgtdf
fef953a48e remove ai.synced_command
fixes #1649 . ai.synced_command could easily be used to implement all types of
undeteced cheats so it was removed. As a replacement this commit adds a
[custom_command] synced command that just calls
wesnoth.game_events.on_synced_command which calls a lua handler that
must first be set.
2018-03-16 13:43:05 +01:00
Charles Dang
0103959c36 Cleaned up deprecated API usage in core Lua
[ci skip]
2018-03-13 16:55:36 +11:00
Charles Dang
471c9e876a Addressed a large chunk of the whitespace issues from #2613
[ci skip]
2018-03-09 11:37:00 +11:00
Charles Dang
3489dac642 [heal_unit]: don't play healed animation if no healing is done
[ci skip]

Addresses #2530. Not closing that though, since the behavior might still be tweaked.

The healer will still play their own animation, if applicable (behavior option 2 in
the bug report).
2018-03-05 15:44:42 +11:00
Celtic Minstrel
f4b031b7ac fixup [deprecated_messag] 2018-03-04 22:03:17 -05:00
Celtic Minstrel
aa0a3bebd1 Add suffix= and prefix= operations to [set_variable] 2018-03-04 22:03:16 -05:00
Celtic Minstrel
1e2512a672 Honour the regular deprecation message settings for WML deprecation messages 2018-03-04 21:21:33 -05:00
Celtic Minstrel
5fc9d8d173 Use new deprecated_message() function wherever possible (C++)
This also covers handling of legacy DescriptionWML for [set_menu_item],
and tweaks its handling in the other cases (mainly [multiplayer_side]).

I added the next_dev_version constant intending to use it, but then
decided not to do so; however I left it in in case someone finds it useful.
2018-03-04 21:21:33 -05:00
Celtic Minstrel
dabf09fce1 Fix deprecation spam
This removes the Lua deprecation_message function in favour of exposing the C++ variant to Lua instead.
It also moves all deprecation messages to a separate logdomain, making them easily enabled en masse.
2018-03-04 21:21:33 -05:00
Celtic Minstrel
29942eec35 Expose side_name attribute to Lua API and [modify_side] 2018-02-18 12:53:00 -05:00
Celtic Minstrel
3440546f2d Some fixes to the Lua deprecation API, and extend it to C++
* Some improvements to the messages
* Don't clobber existing metatables on deprecated subtables
* Fix Lua deprecation messages not even being logged
* Fix deprecation of Lua subtables
* Don't clobber the metatable when deprecating a subtable
2018-02-12 00:09:48 -05:00
Matthias Krüger
dc33cf7ceb pofix: add fixes of previous commits. 2018-02-06 23:03:06 +11:00
Matthias Krüger
b11d3fdcbe fix a bunch of typos found by codespell in data directory.
https://github.com/lucasdemarchi/codespell
2018-02-06 23:03:06 +11:00