mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-14 17:46:14 +00:00
Don't assert on config input.
assert() is not a good way to handle incorrect user input, It is a debugging tool that should only be used for conditions that the program guarantees to be true (unless there a is a bug in the c++ code).
This commit is contained in:
parent
8d2d58d6ec
commit
9f66b1e8ff
|
@ -250,7 +250,7 @@ void helper_advance_unit(const map_location& loc){
|
|||
const unit_type *advanced_type = unit_types.find(advance_unit_typename);
|
||||
if(!advanced_type) {
|
||||
ERR_AI_SIM_ACTIONS << "Simulating advancing to unknown unit type: " << advance_unit_typename;
|
||||
assert(false && "simulating to unknown unit type");
|
||||
return;
|
||||
}
|
||||
advanced_unit->set_experience(advanced_unit->experience_overflow());
|
||||
advanced_unit->advance_to(*advanced_type);
|
||||
|
|
|
@ -634,8 +634,6 @@ void canvas::parse_cfg(const config& cfg)
|
|||
} else {
|
||||
ERR_GUI_P << "Canvas: found a shape of an invalid type " << type
|
||||
<< ".";
|
||||
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user