407 Commits

Author SHA1 Message Date
Jérémy Rosen
aa2e5f1b78 add a filtering on neighbour ability to all animations 2006-11-18 11:38:09 +00:00
Jörg Hinrichs
04f1a065dc Reverts changes from 2006-10-10T19:57:48Z!joerg.hinrichs@alice-dsl.de
(savegame patch), since it causes more problems and i can't care for
it for at least a week.
2006-10-21 19:00:08 +00:00
Rusty Russell
12b65e215f Forward port of 2006-10-18T00:00:10Z!rusty@rustcorp.com.au
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.
2006-10-19 07:59:31 +00:00
Jörg Hinrichs
4069a6811a [[Gamestate and replay fixes]]
- 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
2006-10-10 19:57:48 +00:00
Josef Redinger
ffff58b06a merged sapient 2006-09-25T06:37:36Z!patrick_x99@hotmail.com and 2006-09-25T06:41:13Z!patrick_x99@hotmail.com:
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
2006-09-25 21:15:09 +00:00
Patrick Parker
45881fbf59 prevents crash when replay attempts to rename a null unit 2006-09-25 00:02:40 +00:00
Josef Redinger
108f9d6060 remove segment fault when loading some save game
...and also remove bug with segment fault during creating debug unit
2006-09-24 20:03:24 +00:00
Jörg Hinrichs
db31d57d5d fixes bug #6142 (random variables aren't saved with a replay) 2006-07-21 16:40:14 +00:00
Rusty Russell
50b7429d0f Push config_writer furthur up auto-save callchain.
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.
2006-06-18 05:27:27 +00:00
Patrick Parker
5791580766 view oos details in-game 2006-06-12 16:22:13 +00:00
Rusty Russell
3d280bbc3d Fix OOS bug...
...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.
2006-06-08 07:16:37 +00:00
Gunter Labes
23ca57f01e ran codeclean over all files and set them all to svn:eol-style 'native' 2006-06-05 20:02:25 +00:00
Patrick Parker
77d5023f10 Get side of unit earlier in replay,
...in case game event (capture) changes the unit.
2006-06-04 02:23:38 +00:00
Rusty Russell
edf33fbcfe Fix use-after-possible-move: typed by Rusty for Xan. Should fix 6084 2006-06-04 01:57:24 +00:00
Gunter Labes
bd38112c4e checksum verification of recruitment provided by Xan
(only enabled when starting with --debug)
2006-06-03 18:34:35 +00:00
Dominic Bolin
bbfdfcf9ed fix turn 1 event and [option]s in side turn events 2006-06-02 12:51:40 +00:00
Rusty Russell
d6a7969490 Fix units not being shown when moves done, and glitch when teleporting
(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.
2006-05-29 13:06:23 +00:00
Rusty Russell
ce2ee172ee Fix crash on replays introduced in unit_map changed,
...when unit moved (refresh iterator so it doesn't point to stale value)
2006-05-29 10:46:57 +00:00
Rusty Russell
4197721363 Speed up by keeping unit pointers in map, not units:
...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.
2006-05-28 11:57:45 +00:00
Rusty Russell
bbae6cf1c2 Neatening:
use unit_map everywhere in preparation for making it a real class to
speed up AI
2006-05-28 05:21:57 +00:00
Rusty Russell
61003c69dd Remove all unused warnings, and remove unused function parameters 2006-05-06 15:21:53 +00:00
Rusty Russell
43e16b7f96 Simplify display updating:
...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.
2006-04-29 13:31:07 +00:00
Jörg Hinrichs
c7ce250476 fixes bugs #5794 and #4942 (rng not initialized) 2006-04-17 21:49:55 +00:00
Jörg Hinrichs
45dd38ff87 merges the gameplay_refactoring branch
please report any problems to me
2006-04-06 21:31:55 +00:00
Jörg Hinrichs
48cf5672d9 some final enhancements 2006-04-05 18:36:28 +00:00
Jörg Hinrichs
739b66daf1 Done implementation, before bugfixing 2006-03-29 21:12:27 +00:00
Dominic Bolin
807f6f7d75 All modified source code for the rewrite. 2006-03-20 22:37:59 +00:00
Jörg Hinrichs
cb0392a6f3 implements feature to skip mp replays for observer
(actually they are not really skipped but accelerated quite a lot)
2006-03-04 20:56:24 +00:00
Rusty Russell
bb4ba16e96 Make "viewing_team" a non-optional arg to paths() constructor.
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.
2006-02-22 10:42:13 +00:00
Dominic Bolin
b83ccd632e [special_filter] now works with 'attack' event. 2006-02-20 14:44:34 +00:00
Jérémy Rosen
d5db8ede04 add a command to clear all labels in mp games 2006-02-05 00:34:03 +00:00
Rusty Russell
a5b935bc09 Neaten display::set_paths() and display::set_reach_map().
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.
2006-01-26 02:35:07 +00:00
Jon Daniel
36ad56b673 fix warnings 2006-01-22 10:12:35 +00:00
Jon Daniel
3beddbb93d fix replayer not empty causing shroud clearance without redraw.
Which allowed shroud expanding with undo.
2006-01-22 09:32:05 +00:00
András Salamon
99bbbd6a51 whitespace cleanup 2006-01-12 11:04:50 +00:00
Jérémy Rosen
fa3532bd13 remove of improper dependancy 2006-01-10 22:43:39 +00:00
Jörg Hinrichs
8674b86082 [[vc++ and inclusion handling fixes]]
- 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
2006-01-03 20:04:50 +00:00
Jon Daniel
ecefe45e05 fix default speaker colour 2005-12-29 16:19:04 +00:00
Jérémy Rosen
a250b9877e fix issues with bell and server join messages 2005-12-23 21:01:55 +00:00
Jérémy Rosen
c9090cbc90 added fisher's clock, patch by mtx 2005-12-16 21:52:50 +00:00
Benoît Timbert
734014ff61 Disabled path highlighting diring AI or replay moves 2005-12-14 21:59:18 +00:00
Jérémy Rosen
297a1b710e add anonymous music for unknown teams 2005-12-10 10:11:22 +00:00
Jörg Hinrichs
e194ad7454 [[Unit map fixes]] 2005-11-27 23:12:50 +00:00
Bruno Wolff III
c97df62858 I took the check for the "break" command back out.
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.)
2005-11-17 04:22:52 +00:00
Jörg Hinrichs
732f67480b Adds replay support for "break" command 2005-11-15 23:22:05 +00:00
Jon Daniel
4ffbe0d75d Remove weird debug logging with fds...
...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.
2005-11-13 17:56:51 +00:00
Bruno Wolff III
e4beea352c Change sprintf calls to snprintf in trunk. 2005-11-12 20:25:12 +00:00
Jörg Hinrichs
0f7816c9ef New replay functionality. 2005-11-08 22:23:03 +00:00
David White
73f1b02ec6 fixed compile errors on windows 2005-10-02 18:49:11 +00:00
András Salamon
8d25fb99a6 codeclean in src, mostly Dave's new email address (checked with cvs diff -b)
BY THE WAY, many of the source files have no copyright headers!
2005-07-02 21:37:20 +00:00