mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 14:17:14 +00:00
Check for unit types found before creating units based on them.
This commit is contained in:
parent
4bb579c875
commit
d09401df2c
@ -768,6 +768,8 @@ private:
|
||||
|
||||
const unit_type* att_type = unit_types.find(att);
|
||||
const unit_type* def_type = unit_types.find(def);
|
||||
if ( att_type == NULL || def_type == NULL )
|
||||
return variant();
|
||||
|
||||
unit attacker(att_type, 3, false);
|
||||
unit defender(def_type, 2, false);
|
||||
@ -777,7 +779,6 @@ private:
|
||||
temporary_unit_placer def_place(*resources::units, def_loc, defender);
|
||||
|
||||
|
||||
|
||||
std::pair<double, std::vector<variant> > score = get_battle_score(attacker, defender, att_loc, def_loc);
|
||||
std::pair<double, std::vector<variant> > score2 = get_battle_score(defender, attacker, def_loc, att_loc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user