mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 17:55:27 +00:00
fix(entity): message handlers run in the order they registered, as the client
Handlers sat in an unordered_multimap, whose order for one message is up to the standard library: GCC ran them newest first, so the components loaded last answered a RequestUse first, and Windows builds could differ. They are now kept per message in registration order: the object's own handlers, then its components' in load order (LWOGameObject::PassMessageToComponents). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -480,7 +480,9 @@ private:
|
||||
// objectID of receiver and map of notification name to script
|
||||
std::map<LWOOBJID, std::map<std::string, CppScripts::Script*>> m_Subscriptions;
|
||||
|
||||
std::unordered_multimap<MessageType::Game, std::function<bool(GameMessages::GameMsg&)>> m_MsgHandlers;
|
||||
// Each message's handlers in the order they registered: the object's own, then its components' in load order
|
||||
// (LWOGameObject::registeredGameMessages)
|
||||
std::unordered_map<MessageType::Game, std::vector<std::function<bool(GameMessages::GameMsg&)>>> m_MsgHandlers;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user