Author: suokko
Date: Thu Sep 18 21:17:14 2008
New Revision: 29536
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29536&view=rev
Log:
* Added changelog entries missing from some changes made by me
* Made fake id generator reseted every turn to prevent problems if too many
fake ids is generated
Modified:
trunk/changelog
trunk/players_changelog
trunk/src/actions.cpp
trunk/src/play_controller.cpp
trunk/src/unit_id.cpp
trunk/src/unit_id.hpp
trunk/src/unit_map.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Thu Sep 18 21:17:14 2008
@@ -22,6 +22,16 @@
* WML engine:
* New command, [store_time_of_day], makes it possible to store ToD info
in a WML array/container.
+ * Changed underlying_id in unit to be unique number
+ * AI
+ * Made it possible to use formula AI for recruiting when using default ai
+ * Changed defaults for AI parameters: village_value, villages_per_scout,
+ protect_leader, protect_leader_radius, leader_value
+ * Added new ai paramater number_of_possible_recruits_to_force_recruit which
+ tells AI when it must move leader back to keep.
+ * Improved leader movement and protection.
+ * Improved village grabbing and protection.
+ * Made 'caution' to control how dangerous place AI tries to attack
* Miscellaneous and bug fixes:
* Fixed the list of the unit's attacks getting cut off in the right panel
(bug #12297).
Modified: trunk/players_changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/players_changelog?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/players_changelog (original)
+++ trunk/players_changelog Thu Sep 18 21:17:14 2008
@@ -12,6 +12,9 @@
* Unit changes and balancing
* Made units with the healthy trait take a quarter less damage from poison.
+
+ * AI
+ * Made default AI to play better in multiplayer maps.
Version 1.5.4:
* Editor2
Modified: trunk/src/actions.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Thu Sep 18 21:17:14 2008
@@ -2574,7 +2574,9 @@
// so we can put our unit there, then we'll swap back
at the end.
boost::scoped_ptr<temporary_unit_placer> unit_placer;
if (*step != unit_itor->first)
+ {
unit_placer.reset(new
temporary_unit_placer(units,*step, temporary_unit));
+ }
// In theory we don't know this clone, but
// - he can't be in newly cleared locations
@@ -2602,17 +2604,6 @@
game_events::raise("sighted",*sight_it,unit_itor->first);
sighted_event = true;
}
-
- // NOTE: (invalid now, we track the source, but let the
warning for the moment)
- // There is potential for a bug, here. If the "sighted"
- // events, raised by the clear_shroud_unit function,
- // loops on all units, changing them all, the unit which
- // was swapped by the temporary unit placer will not be
- // affected. However, if we place the pump() out of the
- // temporary_unit_placer scope, the "sighted" event will
- // be raised with an invalid source unit, which is even
- // worse.
- // game_events::pump();
}
}
Modified: trunk/src/play_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/play_controller.cpp?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/src/play_controller.cpp (original)
+++ trunk/src/play_controller.cpp Thu Sep 18 21:17:14 2008
@@ -28,6 +28,7 @@
#include "log.hpp"
#include "sound.hpp"
#include "team.hpp"
+#include "unit_id.hpp"
#include "terrain_filter.hpp"
#include "variable.hpp"
@@ -492,6 +493,7 @@
}
mouse_handler_.deselect_hex();
+ n_unit::id_manager::instance().reset_fake();
game_events::pump();
}
Modified: trunk/src/unit_id.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_id.cpp?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/src/unit_id.cpp (original)
+++ trunk/src/unit_id.cpp Thu Sep 18 21:17:14 2008
@@ -40,6 +40,7 @@
size_t id_manager::next_fake_id()
{
assert(next_id_ != fake_id_);
+ DBG_UT << "fake id: " << fake_id_ << "\n";
return --fake_id_;
}
@@ -50,12 +51,19 @@
void id_manager::set_save_id(size_t id)
{
+ clear();
DBG_UT << "set save id: " << id << "\n";
next_id_ = id;
+ }
+
+ void id_manager::reset_fake()
+ {
+ fake_id_ = -1;
}
void id_manager::clear()
{
next_id_ = 0;
+ reset_fake();
}
}
Modified: trunk/src/unit_id.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_id.hpp?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/src/unit_id.hpp (original)
+++ trunk/src/unit_id.hpp Thu Sep 18 21:17:14 2008
@@ -40,6 +40,7 @@
void set_save_id(size_t);
/** Clears id counter after game */
void clear();
+ void reset_fake();
};
}
Modified: trunk/src/unit_map.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_map.cpp?rev=29536&r1=29535&r2=29536&view=diff
==============================================================================
--- trunk/src/unit_map.cpp (original)
+++ trunk/src/unit_map.cpp Thu Sep 18 21:17:14 2008
@@ -486,10 +486,17 @@
replace(p);
return;
} else {
+ ERR_NG << "Trying to add " << p->second.name() <<
+ " - " << p->second.id() <<
+ " - " << p->second.underlying_id() <<
+ " over " << iter->second.second->second.name() <<
+ " - " << iter->second.second->second.id() <<
+ " - " << iter->second.second->second.underlying_id();
+
assert(false && "Duplicated underlying_id not allowed");
}
- DBG_NG << "Adding unit " << p->second.underlying_id()<< " to location:
(" << p->first.x+1 << "," << p->first.y+1
+ DBG_NG << "Adding unit " << p->second.underlying_id()<< " - " <<
p->second.id() << " to location: (" << p->first.x+1 << "," << p->first.y+1
<< ")\n";
std::pair<lmap::iterator,bool> res =
lmap_.insert(std::make_pair(p->first, unit_id));
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits