mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-19 18:25:27 +00:00
refactor(component): use is a RequestUse message handler
Components no longer have a virtual OnUse; each component that reacts to a use registers a RequestUse handler, like the client's components. The entity runs the INTERACT trigger and the script, then delivers a RequestUseEvent (carrying the user) to the handlers. The mission choice of a multi-interact use goes only to the mission offer, as before. Switches keep a direct EnterIfResponding for touches and pets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ namespace RakNet {
|
||||
|
||||
namespace GameMessages {
|
||||
struct GameMsg;
|
||||
struct RequestUseEvent;
|
||||
}
|
||||
|
||||
class Entity;
|
||||
@@ -61,7 +62,6 @@ public:
|
||||
* Event called when this component is being used, e.g. when some entity interacted with it
|
||||
* @param originator
|
||||
*/
|
||||
virtual void OnUse(Entity* originator) {}
|
||||
|
||||
// A character's save (its XML): read on load, written on save
|
||||
virtual void LoadFromSaveData(const tinyxml2::XMLDocument& doc) {}
|
||||
|
||||
Reference in New Issue
Block a user