This line was not an error -- it is legal in C++ to bind a const
reference to a temporary value. It's only slightly more confusing
than usual in this case because the string it is built from is
a C-string owned by lua, and the temporary std::string object is
implicit.
I don't believe this commit will even make any difference in the
compiled code, it's only slightly simpler and more readable.
After this commit, the "strict mode" lua variable errors may be
disabled with
ilua.strict = false
and reenabled with
ilua.strict = true
There will typically be no noticeable performance difference from
previously to this commit.
This is a bit simpler than the other methods described which
include using pcall or resetting the metatable of _G.
this commit causes wml menu items to have their events registered
not during construction but only when "init_handler" is called.
it refactors the wmi_container object to do this when it
constructs new items via the [set_menu_item] path.
this is necessary because the items might be constructed before
the event queue even exists, and we want them to be able to
persist and be reactivated when a new campaign scenario starts.
more testing is necessary to determine if all code paths, including
carryover and reloading, are still working after this commit, and
the earlier commit 6fc1ac1bb224cddec5ccbb7f7865b69b1b093a01
See also discussion of bug #23115.
[store_side] variable= some_variable[0] ... [/store_side] would result in a wesnoth.set_variable(some_variable[0][0]. ...) call which we don't allow in master after https://github.com/wesnoth/wesnoth/pull/231. 1.12 would just ignore the second index in this case. I decided to rather fix [store_side] than to restore the 1.12 behaviour of set_variable (which wouldn't be harder).
Moves the : and , to lead the lines rather than end them. This
makes the initializer lists a bit more readable, as it lines up
these punctuations and separates them from the initializer
expressions. It seems to be mordante's style in most of the GUI2
code to do it this way. It also has the advantage that each line
is paired with its matching punctuation mark, so if you need to
add or rearrange things, you never need to edit a line solely to
move a comma around, reducing the noise in the diffs.
This allows to remove an unnecessary inclusion. Because the
persist manager is included directly by the play controller header,
this eliminates unnecessary inclusions in many files.
Reverts commit e85c37e161795794e1ae6d2c6b59377a16988c10 which was
an error.
I chose to use a scoped_pointer this time around because the
definition of play_controller should not actually depend on the
complete definition of unit_type.