Commit graph

425 commits

Author SHA1 Message Date
Celtic Minstrel
2a498070f7 fixup 6de1c9441f 2017-03-10 01:16:33 -05:00
Celtic Minstrel
6de1c9441f Fix some [modify_ai] isses (addresses GNA25558)
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.
2017-03-10 00:12:11 -05:00
Celtic Minstrel
9d6b0b2213 Fix another index typo in [animate_unit] 2017-02-28 18:51:24 -05:00
Celtic Minstrel
d6b5f8428a Fix popping one value too many in [animate_unit] 2017-02-28 17:47:41 -05:00
Celtic Minstrel
ee79eb426e Fix some invalid Lua stack accesses in [animate_unit] 2017-02-28 16:26:22 -05:00
Charles Dang
d0837b5d9e Fixup c58e2d00 (backwards logic) 2017-02-28 16:26:31 +11:00
Charles Dang
f81392893d Attempt to fix some errors reported by @singalen 2017-02-27 18:52:10 +11:00
Celtic Minstrel
8822dacd92 Merge branch 'wml_tag_porting' 2017-02-26 19:32:44 -05:00
ln-zookeeper
45c81b3569 Removed deprecation warning of [print] red,green,blue=
Because there isn't any difficulty in supporting both.
2016-12-31 21:31:42 +02:00
Charles Dang
e22c8967ee Cleaned up global.hpp includes 2016-12-17 15:21:04 +11:00
Celtic Minstrel
9802de9813 fixup! Properly port [modify_side] to Lua 2016-12-12 13:49:19 -05:00
Celtic Minstrel
010acd870d Properly port [animate_unit] to Lua 2016-12-11 18:08:08 -05:00
Celtic Minstrel
c58e2d0095 wesnoth.scroll_to_tile can now skip if onscreen 2016-12-11 18:07:46 -05:00
Celtic Minstrel
bf9581cce4 Properly port [heal_unit] to Lua 2016-12-11 18:07:44 -05:00
Celtic Minstrel
37368c3654 Properly port [modify_ai] to Lua 2016-12-11 18:07:40 -05:00
Celtic Minstrel
e0d07e854e Properly port [modify_side] to Lua 2016-12-11 18:07:36 -05:00
gfgtdf
5a13937054 hide wesnoth.fire_wml_menu_item for normal scenarios
as noted in the comment of that function, its only meant to be used in tests.
2016-12-11 19:02:41 +01:00
Charles Dang
b97a20b059 Split SDL_Surface wrapper class and related helper struts into their own file
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.
2016-12-10 22:36:31 +11:00
Charles Dang
4d48ed1319 Cleaned up util.hpp includes 2016-12-08 14:21:18 +11:00
Celtic Minstrel
e7e5ca5fa2 Fix Travis 2016-12-01 15:06:25 +02:00
Charles Dang
58fecf8b54 Bunch of include cleanups 2016-12-01 22:11:00 +11:00
Charles Dang
4b3862493f Convert all usecases of SDL_Color to color_t 2016-11-30 17:59:30 +11:00
Charles Dang
0adeea43e0 Replaced uses of the tod_color struct with color_t 2016-11-30 15:41:18 +11:00
Charles Dang
d8d986d734 Cleaned up a bunch of unnecessary Boost includes 2016-11-30 11:25:22 +11:00
Charles Dang
db3127be03 Replace create_color with a color_t ctor call 2016-11-28 13:31:14 +11:00
Charles Dang
eb3effad21 Replace int_to_color and string_to_color with their appropriate color_t counterparts 2016-11-28 12:17:49 +11:00
Charles Dang
f0f7022d0c Add deprecation notice for red=, green=, blue= in [print]. 2016-11-28 08:27:09 +11:00
Celtic Minstrel
b6c88df9e7 Final sweep of renames to drop t- prefix 2016-11-09 01:28:24 -05:00
Celtic Minstrel
22bbe5465b Rename some misc classes to drop t_ prefix 2016-11-09 01:13:17 -05:00
Celtic Minstrel
b74afeff73 Rename terrain classes to avoid t_ prefix 2016-11-09 01:13:17 -05:00
Charles Dang
8c92a9ee8e Formatting cleanup: moved const qualifiers before type names 2016-10-31 01:04:18 +11:00
Jyrki Vesterinen
e7c2105c48 Add a script to simulate heavy lobby traffic
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.
2016-10-23 16:52:36 +03:00
Celtic Minstrel
09d35947f4 Fix Lua-invoked dialogs not showing before prestart
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.
2016-10-18 12:48:15 -04:00
Gregory A Lundberg
b8244b0694 Correct the calls instead
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.
2016-10-17 10:34:41 -05:00
gfgtdf
844aeb07a2 remvoe wesnoth.fire_event_by_name
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
2016-10-09 20:01:06 +02:00
Jyrki Vesterinen
af733360a8 Fix a bunch of MSVC2015 compiler warnings about hiding declarations
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.
2016-10-06 00:11:56 +03:00
gfgtdf
553ac0fd05 add wml_x/y() getter & setter in map_location 2016-09-16 22:35:41 +02:00
gfgtdf
9cc80973f8 initialize the lua kernel earlier
This allows user defined [effect]s to be used in [unit]s in [side],
previously those units were created before custom effects were available,
2016-09-12 15:59:56 +02:00
Celtic Minstrel
56a0f369cb Add matches method to team metatable 2016-09-11 17:05:53 -04:00
Celtic Minstrel
b8b1e8a223 Store unit methods in metatable instead of doing linear search 2016-09-11 17:05:51 -04:00
Jyrki Vesterinen
7573678201 Fix crash on placing a unit with the scenario editor
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.
2016-09-06 23:03:09 +03:00
Celtic Minstrel
0b15dfd0fc Add many missing override annotations
This mainly fixes cases caught by -Winconsistent-missing-override,
so there are doubtless still many missing ones.
2016-09-04 16:07:55 -04:00
Celtic Minstrel
f24ba1da50 Use reference instead of pointer for pathfinding cost calculator, since it cannot be null 2016-08-31 20:59:59 -04:00
Celtic Minstrel
b5c5e21895 Fix Lua unit types table and add variations subtable to each type 2016-08-28 00:24:17 -04:00
Celtic Minstrel
8bd632f18c Fix wesnoth.find_vacant_tile 2016-08-25 19:22:09 -04:00
Celtic Minstrel
404568c212 Fix gamestate inspector unit tests 2016-08-24 23:18:07 -04:00
Celtic Minstrel
9dbae39448 Minor code cleanup regarding special map locations 2016-08-24 18:45:40 -04:00
Celtic Minstrel
91ed4c3108 Lua: Fix issue with wesnoth.put_recall_unit
This closes #758
2016-08-24 15:10:44 -04:00
Celtic Minstrel
e821e508c3 Merge pull request #744 from lua_refactor
Refactor some Lua stuff and reduce const_cast usage

Conflicts:
	src/scripting/game_lua_kernel.cpp
	src/scripting/lua_unit.cpp
2016-08-24 03:13:38 -04:00
Celtic Minstrel
f6974f01f6 fixup! When creating units in Lua from a vconfig, don't parse any contained [filter_recall] or [event] 2016-08-23 23:07:13 -04:00