Reduce creature spawn stutter from repeated missing-display logging

- add one-time warning caches for missing CreatureDisplayInfo and missing model path lookups
- log each missing displayId/model-path only once instead of every spawn retry/frame
- remove duplicate empty-model-path warning in spawnOnlineCreature (already reported by lookup path)

This cuts high-frequency log I/O and string formatting in hotspots when server sends unknown displayIds, while preserving first-occurrence diagnostics.
This commit is contained in:
Kelsi 2026-02-21 02:43:06 -08:00
parent 0c8798d6b5
commit b2b196aa33
2 changed files with 11 additions and 6 deletions

View file

@ -182,6 +182,8 @@ private:
std::unordered_map<uint64_t, uint8_t> creatureWeaponAttachAttempts_; // guid -> attach attempts
std::unordered_set<uint64_t> deadCreatureGuids_; // GUIDs that should spawn in corpse/death pose
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
uint32_t nextCreatureModelId_ = 5000; // Model IDs for online creatures
uint32_t gryphonDisplayId_ = 0;
uint32_t wyvernDisplayId_ = 0;