46 Commits

Author SHA1 Message Date
Guillaume Melquiond
f85f6821d7 Added current location to unit data. 2009-05-21 14:57:28 +00:00
Guillaume Melquiond
b5717ee623 Removed code duplication. 2009-05-17 20:31:08 +00:00
Guillaume Melquiond
f558add83d Removed unused functions. 2009-05-17 20:30:59 +00:00
Guillaume Melquiond
8fba032a9c Merged find_leader and team_leader into unit_map::find_leader. 2009-05-17 20:30:07 +00:00
Guillaume Melquiond
789736ac91 Removed specialized domains from log.hpp,
...so that adding a new domain no longer forces to recompile the whole
game.
2009-04-24 23:18:31 +00:00
Mark de Wever
4d27743d10 Remove trailing whitespace. 2009-04-04 16:41:28 +00:00
Chris Hopman
594649fd51 - reapply 33603 -- forbid insertion of units with invalid location 2009-03-21 17:55:30 +00:00
Mark de Wever
cf60f87506 Fix a compiler warning. 2009-03-21 14:10:21 +00:00
Chris Hopman
df25acfa03 - simplify match_unit_id 2009-03-21 08:41:38 +00:00
Chris Hopman
c83ef7f2c4 greatly improve unit_map interface documentation
templatize unit_map iterators
2009-03-20 02:13:51 +00:00
Guillaume Melquiond
507cdef31d Forbade insertion of units with invalid location. (Fix for bug #13174.) 2009-03-13 14:14:38 +00:00
Guillaume Melquiond
2f2a238fae Cleaned usage of unit_map::add. 2009-03-13 14:13:30 +00:00
Chris Hopman
71c6468e4b revert unit_map to 2009-01-24T12:44:02Z!patrick_x99@hotmail.com...
...(no need for these changes pre 1.6, what was I thinking?)
2009-02-17 21:36:31 +00:00
Chris Hopman
407a954eb8 greatly improve unit_map interface documentation
templatize unit_map iterators
2009-02-17 08:34:58 +00:00
Patrick Parker
8e57605762 WML Engine:
* Prevent duplicate id conflicts when cloning units with WML (bug #12894)
2009-01-24 12:44:02 +00:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Eric S. Raymond
9223460daa Remove unused headers. 2008-11-09 04:35:13 +00:00
Tomasz Śniatowski
c54a538139 Refactor gamemap::location -- rename to map_location,
...move into separate cpp/hpp pair. The code under src/ was modified
mainly using a global search-and-replace. This change allows reducing
code dependencies and gets rid of inner-class confusion (parts of the
code had to use "location" when referring to gamemap::location, it is
now consistent across the codebase.)
2008-10-15 17:38:51 +01:00
Pauli Nieminen
746c9d211b Fix temporary_unit_placer not to corrupting underlying id for real unit 2008-09-18 20:43:47 +00:00
Pauli Nieminen
e25015a74e Added changelog entries missing from some changes made by me
Made fake id generator reset every turn to prevent problems if too
many fake ids is generated
2008-09-18 19:17:14 +00:00
Pauli Nieminen
e8444eee2f Changed unit::underlying_id_ to integer that is incremented...
...everytime new unit is created

- Fixes problems with duplicated unit_map ids
2008-09-13 21:59:45 +00:00
Pauli Nieminen
3637d5defa Fix underlying id generation for WML created units
Raise unit map duplicate id warning to error level

- This might fix bugs with invalid unit map iterators
2008-09-12 21:51:35 +00:00
Pauli Nieminen
7618bbad51 Fixed unit map copying causing double free 2008-09-02 20:31:24 +00:00
Pauli Nieminen
af509f431c Fixed multiplayer replay switching to next side after victory/defeat,
...removed bogus end turn caused by linger mode (bug #9157)
2008-09-02 20:28:24 +00:00
Patrick Parker
2706f4bf9d prevent a potential crash in unit_map::clean_invalid 2008-09-01 10:19:50 +00:00
Mark de Wever
3a5727e922 Initialize all members. 2008-08-14 16:49:06 +00:00
Mark de Wever
68c80529ca Fix an error in the initialization order in unit_map. 2008-08-05 17:29:48 +00:00
Mark de Wever
7c1f92e565 Initialize all members. 2008-08-05 17:16:17 +00:00
Mark de Wever
95fb849438 Add underscore to private members. 2008-06-22 07:36:56 +00:00
Patrick Parker
edcaad9044 print location for duplicate ID debug message 2008-06-10 09:27:03 +00:00
Patrick Parker
a00bf368fd a real fix for [insert_tag] infinite recursion...
...(for example, inside spawned events.)

attempt to fix the unit_map problem with duplicate ID's (but
apparently not successfully)
2008-06-10 08:51:23 +00:00
Mark de Wever
ffb028e4b5 Update doxygen comment style. 2008-05-21 19:26:59 +00:00
Gunter Labes
469fc378fb redo parts of 2008-02-03T21:36:06Z!patrick_x99@hotmail.com, 2008-02-16T08:47:16Z!koraq@xs4all.nl and 2008-03-01T15:45:18Z!martinxyz@gmx.ch...
...that have been reverted by the formula ai merge
2008-04-25 01:55:51 +00:00
Chris Hopman
1cdbbcf801 fix for bug 11522 2008-04-19 17:59:18 +00:00
Chris Hopman
84d706e8c7 unit_map improvements/cleaning.
Added find(string) by unit.underlying_id()
2008-04-18 02:36:41 +00:00
Rusty Russell
deb8d64d16 Checkin of patch 1020 (file #4046: unit_map_final1.patch) for Sapient. 2008-03-26 00:19:29 +00:00
David White
5c0df60c23 initial branch changes 2008-01-28 03:04:25 +00:00
Mark de Wever
00f2df5042 wassert -> assert 2007-12-10 19:15:15 +00:00
Gunter Labes
ae9e10f260 codeclean run
set svn:eol-style to native where missing
2007-08-31 19:09:40 +00:00
Hans Joachim Gurt
ecea9fbad7 doxygen, comments 2007-08-27 05:01:23 +00:00
Mark de Wever
080eb69f60 Updated the headers to state GPL 2+ and a few changelog cleanups. 2007-08-15 13:41:56 +00:00
Mark de Wever
bb01934b85 A rather large update which updates the copyright info
* Wesnoth is distributed under the terms of the GPL version 2, made
  that more explicit

* updated the copyright range to 2007

* updated Dave's email adress
2007-07-21 07:28:04 +00:00
Gunter Labes
277e325b8b fix copy operator for unit_map provided by Mr. X 2006-06-03 20:35:59 +00:00
Patrick Parker
9f50ebe4a7 fix return type of operator= for VC++ compiler 2006-05-29 03:15:30 +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