This basically adds more reasonable representations of some of the fields, or in some cases just gives them a new, less confusing name.
This also adds wesnoth.scenario.name, which is basically the same as wesnoth.scenario.mp_settings.mp_scenario_name except for the fact that it retains its translatable property
The old ai.synced_command function always set the AI-context game state to changed when executing such a command. This was inadvertently omitted when the implementation was changed to invoke_synced_command in fef953a4. While custom synced commands may or may not change the game state and the engine has no means of determining this correctly in all cases (meaning that neither behavior is technically wrong), the fact that the behavior was changed should be considered a bug. This commit changes it back to how it was before fef953a4.
This delay is to stop the loop running continously, it isn't necessary to do
that when we're about to exit the loop anyway. I'm unsure whether this makes
any noticeable difference, but it seems reasonable to remove delays when
possible.
wml.fire now supports the same syntax - both of the following work:
- wml.fire("message", {message = "Hello World"})
- wml.fire.message{message = "Hello World"}
Instead of this:
for i,t in ipairs(cfg) do
if t[1] == 'foo' then
do_something(t[2])
end
end
You can now write this:
for i,t in ipairs(cfg) do
if t.tag == 'foo' then
do_something(t.value)
end
end
Prior to this, if any .po file included a \v (vertical tab), then the game
exited before reaching the title screen. It didn't have to be in a mainline
translation - any add-on could break the game, and would do so before the title
screen appeared, thus preventing the user from using the add-on manager or
language selection to avoid the problem.
Instead, treat a parsing error similarly to the .po file simply not existing.
Fixes#5923.
The edge-case of calling evaluate_single within an unsynced event was
surprising, and I'm not sure it's correct. However, as we're about to
release the 1.16 branch I think it's better to include that as a test
that the API doesn't change during the stable branch.
Bug #5923 is that a broken .po file can make Wesnoth fail to start, not
even reaching the title screen. Additionally, the error message printed
to the console just said "*timestamp* error general:", and then missed
the details of what had broken.
This commit fixes the error message to show which add-on and which line
are causing the problem.
This is the real cause of the breakage in 5a9c24c4e79d624e34aa475949a4aa49b1984322 and d04bd2bf5d2ad932ca9bb3203f4ff9f91411e261.
A returned location now has both x/y and 1/2, so the location_set logic removed the x/y but kept the 1/2, causing it to break when converted to a config.
This makes it use rawget when the value is a table, which fixes it.