mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 17:27:07 +00:00
Fix bug #21365 - make MP modification dep checks revert properly if not compatible.
This commit is contained in:
parent
c639195cd2
commit
9f9a7b9460
@ -113,6 +113,7 @@ Version 1.11.7+dev:
|
||||
* Fixed file chooser dialog (used in the map editor and for locating the
|
||||
wesnothd executable) interpreting special markup at the beginning of file
|
||||
names such as "#foo.map".
|
||||
* Fixed bug with modifications dependency check dialogs (bug #21365)
|
||||
|
||||
Version 1.11.7:
|
||||
* Add-ons client:
|
||||
|
@ -358,18 +358,19 @@ void manager::try_modifications(const std::vector<std::string>& ids, bool force)
|
||||
void manager::try_modification_by_index(int index, bool activate, bool force)
|
||||
{
|
||||
std::string id = depinfo_.child("modification", index)["id"];
|
||||
std::vector<std::string> mods_copy = mods_;
|
||||
if (activate) {
|
||||
if (std::find(mods_.begin(), mods_.end(), id) == mods_.end()) {
|
||||
mods_.push_back(id);
|
||||
if (std::find(mods_copy.begin(), mods_copy.end(), id) == mods_copy.end()) {
|
||||
mods_copy.push_back(id);
|
||||
}
|
||||
} else {
|
||||
std::vector<std::string>::iterator pos = std::find(mods_.begin(), mods_.end(), id);
|
||||
if (pos != mods_.end()) {
|
||||
mods_.erase(pos);
|
||||
std::vector<std::string>::iterator pos = std::find(mods_copy.begin(), mods_copy.end(), id);
|
||||
if (pos != mods_copy.end()) {
|
||||
mods_copy.erase(pos);
|
||||
}
|
||||
}
|
||||
|
||||
try_modifications(mods_, force);
|
||||
try_modifications(mods_copy, force);
|
||||
};
|
||||
|
||||
void manager::try_era_by_index(int index, bool force)
|
||||
|
Loading…
x
Reference in New Issue
Block a user