Soliton got an assert in battle_context observing game using old era data.
We should go OOS when defender weapon is impossible, as we do for
attacker weapon.
- makes some use of gamestate wording more consistent
- enables (again) saving of events and variables for mp savegames
- uses the same gamestate information for mp saves, campaign saves and autosaves
- keeps replay information for mp saves so that they always start from
the beginning
- corrects the messed up savegame WML structure
I tested this in itself but not against latest changes: If there are
any incompatibilities/problems please tell me
Two whisper fixes:
* ignore chat command should also ignore whispers
* whispers received while in quick replay mode should be displayed
Note: whispers received while in quick replay mode will still not
appear until the quick replay finishes. It would be better if they
showed up immediately.
removing a redundant cwhisper definition
Doesn't make any difference yet, but eventually we should be creating
config_writer at top level and passing it around for each subsystem to
write to it, instead of pasting together a config from each subsystem
then writing the whole thing out.
...where one player (or observer) chooses a different defensive
weapon, as seen by Soliton (IIRC)
Xan pointed out this was a possibility: we calculate defense weapon
now based on attack_prediction code, but this uses floating point
calculations, which means that in the case where results are close,
rounding differences can mean that both ends choose different weapons.
The answer is to store the defense weapon as well as the attack
weapon, and pass it to all the relevent routines.
(drawn in wrong place).
The correct way of moving a unit is: set_hidden(true),
unit_display::move(), set_hidden(false). This means that unit count
on the status display does not drop mysteriously, unlike doing the
obvious: units.extract(loc), unit_display::move(). But it means that
unit_display needs to use a copy for the temporary unit it draws on
the screen, and mark that copy non-hidden, otherwise it draws a hidden
unit, ie. nothing.
...makes AI sims much faster (class unit are now far too large to copy
cheaply).
2p Blitz 800 gold turn 7 used to test:
Before: 20 seconds to first AI move, 3:40 for AI turn.
After: 7 seconds to first move, 1:02 for entire AI turn.
(note: most of the remainder is animation time).
To avoid everyone having to deal with pointers, new unit_map class
works exactly like the old std::map unless you are
adding/deleting/moving units.
dfool: I removed a couple of redundant clear() calls in your AI, too.
...always use display::invalidate() then display::draw(), not
display::draw_tile().
This means display needs to be told about moving units (can't be on
map, because can overlap). This means there is only one caller of
draw_tile (draw), so it can figure out all the drawing which needs
doing and do units right at end, dealing with overlap. We currently
invalidate all hexes around any unit: if this is too slow, we should
ask the unit itself what hexes it overlaps.
Callers must understand the difference between asking for paths to
draw them (ie. viewing_player()) and to actually move something
(ie. current_player()). Most importantly, this fixes#5362 where you
can detect hidden enemy units by mousing over your own players during
an enemy move.
Bug #5145 was caused by a missing set_paths(NULL), because the display
object used to keep the paths pointer it was passed.
This is unnecessary, because the gui only needs to keep which tiles to
highlight: it does not need to keep the paths themselves. Also, both
interfaces are very similar and should be combined. While we're
there, rename them: we don't use it for the actual "route"
highlighting (ie. the footsteps), just for showing where a unit/units
can reach.
- changed include paths to be relative to source root
- removed some unnecessary includes
- added some includes of global.hpp to editor files to prevent useless vc++ compiler warnings
- Extended vc++ project files
- fixed the bug of having to press escape two times in a continuous replay to get back to the titlescreen
This is being dropped from the 1.0.x series. (Also providing backward
compatibility for replay and saved games isn't going to be practical
in any case.)
...which tries to create files in the cwd and writes to them without
error checking PLEASE USE the functionality provided by the LOGGING
SYSTEM and manually redirect the output to a file.