Add an error message if an invalid defence modifier is used,
...discovered in debian bug 467253. A proper fix will be posted post 1.4.
This commit is contained in:
parent
c903e63a98
commit
11f56e98ec
1 changed files with 3 additions and 1 deletions
|
@ -51,6 +51,7 @@
|
|||
#define DBG_UT LOG_STREAM(debug, engine)
|
||||
#define LOG_UT LOG_STREAM(info, engine)
|
||||
#define ERR_UT LOG_STREAM(err, engine)
|
||||
#define ERR_CONFIG LOG_STREAM(err, config)
|
||||
|
||||
namespace {
|
||||
const std::string ModificationTypes[] = { "advance", "trait", "object" };
|
||||
|
@ -2084,7 +2085,7 @@ int unit::defense_modifier(t_translation::t_terrain terrain, int recurse_count)
|
|||
|
||||
if(defense != NULL) {
|
||||
if(underlying.size() != 1) {
|
||||
LOG_STREAM(err, config) << "terrain '" << terrain << "' has "
|
||||
ERR_CONFIG << "terrain '" << terrain << "' has "
|
||||
<< underlying.size() << " underlying names - 0 expected\n";
|
||||
return 100;
|
||||
}
|
||||
|
@ -2096,6 +2097,7 @@ int unit::defense_modifier(t_translation::t_terrain terrain, int recurse_count)
|
|||
}
|
||||
}
|
||||
if(res <= 0) {
|
||||
ERR_CONFIG << "Defence '" << res << "' is '<= 0' reset to 50.\n";
|
||||
res = 50;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue