record unit recuitment before unit creation.

This commit is contained in:
gfgtdf 2013-12-05 16:24:39 +01:00
parent a20b6d2647
commit 92bcca25fc

View file

@ -932,11 +932,12 @@ void recruit_unit(const unit_type & u_type, int side_num, const map_location & l
const map_location & from, bool show, bool use_undo,
bool use_recorder)
{
const unit new_unit(u_type, side_num, true);
// Record this before actually recruiting.
if ( use_recorder )
recorder.add_recruit(u_type.id(), loc, from);
const unit new_unit(u_type, side_num, true);
// Place the recruit.
bool mutated = place_recruit(new_unit, loc, from, u_type.cost(), false, show);