HomeWildfire Games

Hotloading fix after rP25210

Description

Hotloading fix after rP25210

Emplace does not replace existing element, insert_or_assign does.

While at it:

  • Clean up the 'outdated' logic and reuse it for actors
  • When an actor fails to load, return a placeholder. This improves hotloading of broken actors, and makes Cunit behaviour more predictable.
  • Some minor cleanup

Reported by: Stan

Fixes #6157

Differential Revision: https://code.wildfiregames.com/D3882

Event Timeline

Unit.cpp
../../../source/graphics/Unit.cpp: In static member function ‘static CUnit* CUnit::Create(const CStrW&, uint32_t, const std::set<CStr8>&, CObjectManager&)’:
../../../source/graphics/Unit.cpp:44:22: warning: unused variable ‘success’ [-Wunused-variable]
  auto [success, actor] = objectManager.FindActorDef(actorName);
                      ^
vladislavbelov raised a concern with this commit.Jun 16 2021, 3:11 PM
vladislavbelov added a subscriber: vladislavbelov.
vladislavbelov added inline comments.
/ps/trunk/source/graphics/ObjectManager.cpp
160–163

That introduced #6228.

This commit now has outstanding concerns.Jun 16 2021, 3:11 PM
vladislavbelov resigned from this commit.Jun 21 2021, 1:57 PM
This commit no longer requires audit.Jun 21 2021, 1:57 PM