diff options
Diffstat (limited to 'src/RendererWorld.cpp')
-rw-r--r-- | src/RendererWorld.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index 6349573..628680c 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -170,17 +170,15 @@ RendererWorld::RendererWorld(GameState* ptr) { auto it = sections.find(parsing[id].renderer.sectionPos); - if (it != sections.end() && parsing[id].renderer.hash == it->second.GetHash() && !parsing[id].renderer.forced) { - LOG(WARNING) << "Generated not necessary RendererSectionData: " << parsing[id].renderer.sectionPos; - return; - } - - if (it != sections.end()) - sections.erase(it); - - const RendererSectionData &data = parsing[id].renderer; - - sections.emplace(std::make_pair(parsing[id].renderer.sectionPos, RendererSection(data))); + if (it != sections.end()) { + if (parsing[id].renderer.hash == it->second.GetHash() && !parsing[id].renderer.forced) { + LOG(WARNING) << "Generated not necessary RendererSectionData: " << parsing[id].renderer.sectionPos; + parsing[id] = RendererWorld::SectionParsing(); + return; + } + it->second.UpdateData(parsing[id].renderer); + } else + sections.emplace(std::make_pair(parsing[id].renderer.sectionPos, RendererSection(parsing[id].renderer))); parsing[id] = RendererWorld::SectionParsing(); }); |