Fix bug #6092
where we crash after creating unit of non-existant type: throw exception so they get error dialog.
This commit is contained in:
parent
b696745d05
commit
f4e54beef5
1 changed files with 1 additions and 0 deletions
|
@ -948,6 +948,7 @@ void unit::read(const config& cfg)
|
|||
type_set = true;
|
||||
} else {
|
||||
LOG_STREAM(err, engine) << "unit of type " << cfg["type"] << " not found!\n";
|
||||
throw game::game_error("Unknown unit type '" + cfg["type"] + "'");
|
||||
}
|
||||
attacks_left_ = max_attacks_;
|
||||
if(cfg["moves"]=="") {
|
||||
|
|
Loading…
Add table
Reference in a new issue