mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 21:27:45 +00:00
Fix model switching in armoury
This commit is contained in:
parent
82abee1d74
commit
b50a058d86
2 changed files with 18 additions and 8 deletions
|
@ -348,14 +348,23 @@ void GearView::updatePart()
|
|||
}
|
||||
|
||||
for (auto &queuedRemoval : queuedGearRemovals) {
|
||||
mdlPart->removeModel(queuedRemoval.mdl);
|
||||
loadedGears.erase(std::remove_if(loadedGears.begin(),
|
||||
loadedGears.end(),
|
||||
[queuedRemoval](const LoadedGear &other) {
|
||||
return queuedRemoval.info == other.info;
|
||||
}),
|
||||
loadedGears.end());
|
||||
auto it = std::find_if(loadedGears.cbegin(), loadedGears.cend(), [queuedRemoval](const LoadedGear &other) {
|
||||
return queuedRemoval.info == other.info;
|
||||
});
|
||||
|
||||
if (it != loadedGears.cend()) {
|
||||
mdlPart->removeModel((*it).mdl);
|
||||
loadedGears.erase(std::remove_if(loadedGears.begin(),
|
||||
loadedGears.end(),
|
||||
[queuedRemoval](const LoadedGear &other) {
|
||||
return queuedRemoval.info == other.info;
|
||||
}),
|
||||
loadedGears.end());
|
||||
}
|
||||
}
|
||||
|
||||
queuedGearAdditions.clear();
|
||||
queuedGearRemovals.clear();
|
||||
}
|
||||
|
||||
if (face) {
|
||||
|
|
|
@ -278,9 +278,10 @@ void MDLPart::removeModel(const physis_MDL &mdl)
|
|||
models.erase(std::remove_if(models.begin(),
|
||||
models.end(),
|
||||
[mdl](const RenderModel &other) {
|
||||
return mdl.lods == other.model.lods;
|
||||
return mdl.p_ptr == other.model.p_ptr;
|
||||
}),
|
||||
models.end());
|
||||
Q_EMIT modelChanged();
|
||||
}
|
||||
|
||||
#include "moc_mdlpart.cpp"
|
Loading…
Add table
Reference in a new issue