RoR2-ChensHelpers

Contains simple and useful helpers for RoR2 mod creators to use. Mainly caters to Chen's mods.

View on GitHub

ChensHelpers

Chen.Helpers.GeneralHelpers.MinionExtensions

MinionExtensions.AssignOwner(CharacterMaster, CharacterMaster, bool, bool) Method

Assigns a new owner to the minion. This needs to be called on both the Server and the Client.
If transmit is true, it only needs to be called on the server.
The queuing system provides a way to ensure that all clients will sync the owner. This is a slow process though.
Only set useQueue to true if the client cannot see the objects and returns a warning of the object being null.

public static void AssignOwner(this CharacterMaster minion, CharacterMaster newOwner, bool transmit=false, bool useQueue=false);

Parameters

minion RoR2.CharacterMaster
Minion to set a new owner with

newOwner RoR2.CharacterMaster
New owner of the minion

transmit System.Boolean
Determines whether the server would send a sync message to other clients

useQueue System.Boolean
Tells the client to use a queuing system if transmit is true