As far as I can tell, the most likely cause of the bug was that several
cases of [modify_ai]action=add were called with a path that lacked the final
empty braces at the end of the path.
This commit makes both the tag and the underlying Lua API calls explicitly
handle this case as if the final empty braces were, in fact, present.
This (should) allow sdl/utils.hpp to be modified without a huge rebuild, since a number
of widely used headers included that file simply for the surface class type.
Plus a bunch of changes which were necessary for the script to work:
* The "simulate lobby activity" plugin now exits when the server is shut
down.
* The plugin now uses wesnoth.random() for random number generation.
Math.random() uses a fixed seed, which would make all the clients
perform the exact same actions.
* Exposed wesnoth.random() to plugins to allow the change above.
* --nogui no longer implies --wconsole on Windows. With implied --wconsole
the clients attached themselves to the standard output of the Python
script, which made it impossible to see the output of the script itself.
Instead of passing the video object to the Lua kernel, the game now simply
fetches the video singleton when displaying dialogs. This means there is
no longer any need to store a reference to the video object.
Do not change the released Lua source code. Lua is written as standard C, but we compile it as C++ so we can use exceptions. Change the call sites to avoid the warnings about using a C cast instead of static_cast<int>().
NB: The changes to Wesnoth C++ code will be required to upgrade to Lua 5.3, anyway.
This reverts:
commit cee3ab2084
Author: Mark de Wever <koraq@xs4all.nl>
Date: Sun Feb 5 19:55:32 2012 +0000
Fix compiler warnings.
there is already a function wesnoth.fire_event which does the same. Even thouigh it is now possible to fire events by id, fireing events by name is still the normal way since thats what people usually want to do. So there is no need to have a second alias fire_event_by_name
This commit still doesn't fix all of them. I decided to leave alone
cases where variables with the same name are assigned in multiple
conditions of the same if...else if...else statement, and cases where a
scope logging macro is used multiple times in the same scope. In any
case, this commit greatly reduces the warning count on MSVC2015 and makes
new warnings much easier to spot.
The unit::get_ability_bool() function accessed resources::gameboard that
is not set in the editor. Now the function receives the display context
as a parameter instead.
I also fixed two crashes on editor startup in MSVC debug builds (both
caused by indexing the teams vector when there aren't any teams), and the
GUI2 unit list dialog showing wrong status icons.