Worked around an assertion failure...

...when Formula AI recruits by overwriting the invalid recruit location.
This commit is contained in:
Guillaume Melquiond 2009-07-26 16:56:40 +00:00
parent c564317690
commit e33f90a2ab
2 changed files with 5 additions and 7 deletions

View File

@ -211,7 +211,7 @@ bool can_recruit_on(const gamemap& map, const map_location& leader, const map_lo
}
std::string recruit_unit(int side, const unit &new_u,
const map_location &recruit_loc, bool is_recall,
map_location &recruit_location, bool is_recall,
bool show, bool need_castle, bool full_movement,
bool wml_triggered)
{
@ -219,8 +219,6 @@ std::string recruit_unit(int side, const unit &new_u,
LOG_NG << "recruiting unit for side " << side << "\n";
map_location recruit_location = recruit_loc;
// Find the unit that can recruit
unit_map::const_iterator u = resources::units->begin(),
u_end = resources::units->end(), l = u_end, leader = u_end;

View File

@ -48,15 +48,15 @@ struct end_level_exception;
* If @a need_castle is true, then the new unit must be on the same castle
* as the leader of the team is on the keep of.
*
* If @a preferred_location is a valid location, it will be used,
* otherwise a valid location will be arbitrarily chosen.
* If @a disp is not NULL, the new unit will be faded in.
* If @a recruit_location is a valid location, it will be used,
* otherwise a valid location will be arbitrarily chosen and returned
* (hence the non-const reference).
*
* @return an empty string on success. Otherwise a human-readable message
* describing the failure is returned.
*/
std::string recruit_unit(int side, const unit &u,
const map_location &recruit_location, bool is_recall,
map_location &recruit_location, bool is_recall,
bool show = false, bool need_castle = true,
bool full_movement = false, bool wml_triggered = false);