fix a slight problem with the submerge animation parameter...

...always being overridden by the engine.
This commit is contained in:
Jérémy Rosen 2009-02-22 10:43:54 +00:00
parent 579bed74f9
commit 646325a13e
3 changed files with 5 additions and 1 deletions

View File

@ -1461,6 +1461,9 @@ void formula_ai::make_candidate_moves() {
variant enemy_unit_callable(new unit_callable(*(*best_move)->get_enemy_unit()));
callable.add("target", enemy_unit_callable);
}
game_display::get_singleton()->float_label(
(*(*best_move)->get_action_unit()).first,
(*best_move)->get_name(),0,0,0);
const_formula_ptr move_formula((*best_move)->get_move());
make_move(move_formula, callable);
// And re-evaluate candidate moves

View File

@ -43,6 +43,7 @@ public:
void evaluate_move(const formula_ai* ai, unit_map& units, size_t team_num);
int get_score() const {return score_;}
const std::string& get_name() { return name_;}
std::string get_type() const {return type_;}
unit_map::unit_iterator get_action_unit() {return action_unit_;}
unit_map::unit_iterator get_enemy_unit() {return enemy_unit_;}

View File

@ -585,7 +585,7 @@ const frame_parameters unit_frame::merge_parameters(int current_time,const frame
/** engine provides a submerge for units in water */
result.submerge = current_val.submerge?current_val.submerge:animation_val.submerge;
if(primary && engine_val.submerge) result.submerge = engine_val.submerge;
if(primary && engine_val.submerge && !result.submerge ) result.submerge = engine_val.submerge;
assert(engine_val.x == 0);
result.x = current_val.x?current_val.x:animation_val.x;