AI recruitment: use unit-specific recall cost
… when deciding whether a recall is worth it.
This commit is contained in:
parent
c4ebb1cea6
commit
e1da42ea91
1 changed files with 5 additions and 1 deletions
|
@ -499,7 +499,11 @@ double recruitment::recall_unit_value(const unit_const_ptr & recall_unit) const
|
|||
double xp_quantity = static_cast<double>(recall_unit->experience()) /
|
||||
recall_unit->max_experience();
|
||||
double recall_value = recall_unit->cost() + xp_quantity * average_cost_of_advanced_unit;
|
||||
if (recall_value < current_team().recall_cost()) {
|
||||
int cost = current_team().recall_cost();
|
||||
if (recall_unit->recall_cost() > -1) {
|
||||
cost=recall_unit->recall_cost();
|
||||
}
|
||||
if (recall_value < cost) {
|
||||
recall_value = -1; // Unit is not worth to get recalled.
|
||||
}
|
||||
return recall_value;
|
||||
|
|
Loading…
Add table
Reference in a new issue