Remove nearest-known displayId model fallback cache for missing creature display mappings - that was weird and I'm done with the horror show

This commit is contained in:
Kelsi 2026-02-21 04:18:14 -08:00
parent fa3060bdf7
commit 21f7b0f199
2 changed files with 0 additions and 49 deletions

View file

@ -184,8 +184,6 @@ private:
std::unordered_map<uint32_t, uint32_t> displayIdModelCache_; // displayId → modelId (model caching)
mutable std::unordered_set<uint32_t> warnedMissingDisplayDataIds_; // displayIds already warned
mutable std::unordered_set<uint32_t> warnedMissingModelPathIds_; // modelIds/displayIds already warned
mutable std::unordered_map<uint32_t, std::string> missingDisplayFallbackPathCache_; // missing displayId -> fallback model path
mutable std::unordered_set<uint32_t> warnedMissingDisplayFallbackIds_; // displayIds logged for fallback usage
uint32_t nextCreatureModelId_ = 5000; // Model IDs for online creatures
uint32_t gryphonDisplayId_ = 0;
uint32_t wyvernDisplayId_ = 0;

View file

@ -496,8 +496,6 @@ void Application::reloadExpansionData() {
creatureModelIds_.clear();
creatureRenderPosCache_.clear();
nonRenderableCreatureDisplayIds_.clear();
missingDisplayFallbackPathCache_.clear();
warnedMissingDisplayFallbackIds_.clear();
buildCreatureDisplayLookups();
}
@ -512,8 +510,6 @@ void Application::logoutToLogin() {
wasAutoAttacking_ = false;
loadedMapId_ = 0xFFFFFFFF;
nonRenderableCreatureDisplayIds_.clear();
missingDisplayFallbackPathCache_.clear();
warnedMissingDisplayFallbackIds_.clear();
world.reset();
if (renderer) {
// Remove old player model so it doesn't persist into next session
@ -3484,15 +3480,6 @@ std::string Application::getModelPathForDisplayId(uint32_t displayId) const {
auto itData = displayDataMap_.find(displayId);
if (itData == displayDataMap_.end()) {
if (displayId > 1000000u) {
static uint32_t suspiciousDisplayIdDrops = 0;
++suspiciousDisplayIdDrops;
if (suspiciousDisplayIdDrops <= 3 || (suspiciousDisplayIdDrops % 100) == 0) {
LOG_WARNING("Skipping suspicious displayId ", displayId,
" (likely malformed movement/update parse)");
}
return "";
}
// Some sources (e.g., taxi nodes) may provide a modelId directly.
auto itPath = modelIdToPath_.find(displayId);
if (itPath != modelIdToPath_.end()) {
@ -3500,40 +3487,6 @@ std::string Application::getModelPathForDisplayId(uint32_t displayId) const {
}
if (displayId == 30412) return "Creature\\Gryphon\\Gryphon.m2";
if (displayId == 30413) return "Creature\\Wyvern\\Wyvern.m2";
auto itCachedFallback = missingDisplayFallbackPathCache_.find(displayId);
if (itCachedFallback != missingDisplayFallbackPathCache_.end()) {
return itCachedFallback->second;
}
uint32_t bestDisplayId = 0;
uint32_t bestDelta = std::numeric_limits<uint32_t>::max();
std::string bestPath;
for (const auto& [candidateDisplayId, candidateData] : displayDataMap_) {
auto itCandidatePath = modelIdToPath_.find(candidateData.modelId);
if (itCandidatePath == modelIdToPath_.end() || itCandidatePath->second.empty()) {
continue;
}
uint32_t delta = (candidateDisplayId > displayId)
? (candidateDisplayId - displayId)
: (displayId - candidateDisplayId);
if (delta < bestDelta) {
bestDelta = delta;
bestDisplayId = candidateDisplayId;
bestPath = itCandidatePath->second;
if (delta == 0) break;
}
}
if (!bestPath.empty()) {
missingDisplayFallbackPathCache_[displayId] = bestPath;
if (warnedMissingDisplayFallbackIds_.insert(displayId).second) {
LOG_WARNING("No display data for displayId ", displayId,
" — using nearest fallback displayId ", bestDisplayId,
" (delta=", bestDelta, ") path=", bestPath);
}
return bestPath;
}
if (warnedMissingDisplayDataIds_.insert(displayId).second) {
LOG_WARNING("No display data for displayId ", displayId,
" (displayDataMap_ has ", displayDataMap_.size(), " entries)");