mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-07 05:56:28 +00:00
don't abort advancement on invalid advancement index
this would in theory give the player the option to postpone a unit advancement by selecting an invalid advancement index. Now we just use the first advancement in case of an invalid advancement index.
This commit is contained in:
parent
b67579a030
commit
7ddf61f08a
@ -111,9 +111,10 @@ namespace
|
||||
const std::vector<std::string>& options = u->advances_to();
|
||||
std::vector<config> mod_options = u->get_modification_advances();
|
||||
|
||||
assert(options.size() + mod_options.size() > 0);
|
||||
if (choice >= options.size() + mod_options.size()) {
|
||||
LOG_DP << "animate_unit_advancement suppressed: invalid option\n";
|
||||
return false;
|
||||
LOG_DP << "animate_unit_advancement: invalid option, using first option\n";
|
||||
choice = 0;
|
||||
}
|
||||
|
||||
// When the unit advances, it fades to white, and then switches
|
||||
|
Loading…
x
Reference in New Issue
Block a user