where we crash after creating unit of non-existant type: throw
exception so they get error dialog.
This commit is contained in:
Rusty Russell 2006-06-05 07:59:57 +00:00
parent b696745d05
commit f4e54beef5

View file

@ -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"]=="") {