allow client to force control husk and add a hook

This commit is contained in:
zhurengong
2021-11-19 03:05:44 +08:00
parent 3a4f3cded4
commit b291624544
2 changed files with 9 additions and 1 deletions
@@ -235,13 +235,14 @@ namespace Barotrauma
if (Prefab is AfflictionPrefabHusk huskPrefab)
{
if (huskPrefab.ControlHusk)
if (huskPrefab.ControlHusk || GameMain.Lua.game.enableControlHusk)
{
#if SERVER
var client = GameMain.Server?.ConnectedClients.FirstOrDefault(c => c.CharacterInfo.Character == character);
if (client != null)
{
GameMain.Server.SetClientCharacter(client, husk);
GameMain.Lua.hook.Call("husk.clientControlHusk", new object[] { client, husk });
}
#else
if (!character.IsRemotelyControlled && character == Character.Controlled)