plenty of new things

This commit is contained in:
Evil Factory
2021-08-15 17:17:49 -03:00
parent 06f40fa368
commit a2cb256aa6
10 changed files with 109 additions and 18 deletions
@@ -3,6 +3,7 @@ using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Text;
using MoonSharp.Interpreter;
namespace Barotrauma.Networking
{
@@ -93,6 +94,11 @@ namespace Barotrauma.Networking
ChatMessage.CanUseRadio(sender.Character, out WifiComponent senderRadio) &&
ChatMessage.CanUseRadio(recipient.Character, out WifiComponent recipientRadio))
{
var should = GameMain.Lua.hook.Call("canUseVoiceRadio", new DynValue[] { UserData.Create(sender), LuaSetup.CreateUserDataSafe(recipient) });
if (should != null)
return should.CastToBool();
if (recipientRadio.CanReceive(senderRadio)) { return true; }
}