- Call shared_from_this() instead of taking the address
- Don't use raw pointers to attack_type
- Change some cases of attack_type objects that weren't owned by a shared_ptr
(either owned by another object or allocated directly on the stack)
List of files that currently call attack_type constructors:
- game_events/conditional_wml.cpp
- gui/dialogs/unit_attack.cpp
- scripting/lua_unit_attacks.cpp
- units/types.cpp
- units/unit.cpp
Each of these has been individually considered and made safe for use with
enable_shared_from_this. (Most of them already were safe.)
I was performing a value check on fade_step in the timer, and then multiplying it fivefold in the alpha
calculation, meaning full alpha was reached long before the fade in sequence stopped and the duration timer
was initialized.
Since all the floating images' data was set with a formula that relied on a canvas-wide variable whose value
was constantly changing and no serialization was done, the formulas all evaluated to the same location.
To fix this, we do away with the use of the variables and insert the necessary values directly into the formula
string.
For rectangles, color_t::null_color() needs to be specified as the default since typed_formula
utilizes the default type ctor if no default value is provided. In this case, color_t's default
ctor returns opaque white, which doesn't mesh well with GUI2's drawing.
Other shapes don't get this default value, since color is essentially mandatory for them, whereas
in rectangles either fill_color or border_color may be omitted.
Essentially, I delegated the call to variant::evaluate to the operator() function and not the execute
specializations, which are now passed he resulting variant instead.
That and a ton of formatting and a bunch of moving stuff around.
This fixes several warnings of this type:
ld: warning: direct access in return_to_play_side_exception::execute()
to global weak symbol typeinfo for lua_jailbreak_exception means the
weak symbol cannot be overridden at runtime. This was likely caused by
different translation units being compiled with different visibility
settings.