refactor: no more dynvalues or userdatas
This commit is contained in:
@@ -441,7 +441,7 @@ namespace Barotrauma.Items.Components
|
||||
#if SERVER
|
||||
if (!lastSignal.ContainsValue(connection.Name) || lastSignal[connection.Name] != signal.value)
|
||||
{
|
||||
GameMain.Lua.hook.Call("signalReceived", new DynValue[] { UserData.Create(signal), UserData.Create(connection) });
|
||||
GameMain.Lua.hook.Call("signalReceived", new object[] { signal, connection });
|
||||
|
||||
lastSignal[connection.Name] = signal.value;
|
||||
}
|
||||
|
||||
@@ -187,10 +187,18 @@ namespace Barotrauma.Items.Components
|
||||
if (senderComponent != null && !CanReceive(senderComponent)) { return; }
|
||||
|
||||
#if SERVER
|
||||
var should = GameMain.Lua.hook.Call("wifiSignalTransmitted", new DynValue[] { UserData.Create(this), UserData.Create(signal), DynValue.NewBoolean(sentFromChat) });
|
||||
var should = GameMain.Lua.hook.Call("wifiSignalTransmitted", new object[] { this, signal, sentFromChat });
|
||||
|
||||
if (should != null && should.CastToBool())
|
||||
return;
|
||||
if (should != null)
|
||||
{
|
||||
if (should is DynValue dyn)
|
||||
{
|
||||
if (dyn.CastToBool())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool chatMsgSent = false;
|
||||
|
||||
Reference in New Issue
Block a user