mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-26 05:37:46 +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) {
|
for (auto &queuedRemoval : queuedGearRemovals) {
|
||||||
mdlPart->removeModel(queuedRemoval.mdl);
|
auto it = std::find_if(loadedGears.cbegin(), loadedGears.cend(), [queuedRemoval](const LoadedGear &other) {
|
||||||
loadedGears.erase(std::remove_if(loadedGears.begin(),
|
return queuedRemoval.info == other.info;
|
||||||
loadedGears.end(),
|
});
|
||||||
[queuedRemoval](const LoadedGear &other) {
|
|
||||||
return queuedRemoval.info == other.info;
|
if (it != loadedGears.cend()) {
|
||||||
}),
|
mdlPart->removeModel((*it).mdl);
|
||||||
loadedGears.end());
|
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) {
|
if (face) {
|
||||||
|
|
|
@ -278,9 +278,10 @@ void MDLPart::removeModel(const physis_MDL &mdl)
|
||||||
models.erase(std::remove_if(models.begin(),
|
models.erase(std::remove_if(models.begin(),
|
||||||
models.end(),
|
models.end(),
|
||||||
[mdl](const RenderModel &other) {
|
[mdl](const RenderModel &other) {
|
||||||
return mdl.lods == other.model.lods;
|
return mdl.p_ptr == other.model.p_ptr;
|
||||||
}),
|
}),
|
||||||
models.end());
|
models.end());
|
||||||
|
Q_EMIT modelChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_mdlpart.cpp"
|
#include "moc_mdlpart.cpp"
|
Loading…
Add table
Reference in a new issue