From caac190a05328c0f9cde1ee3917ceca3dfc46d2c Mon Sep 17 00:00:00 2001 From: Roland Firmont Date: Mon, 21 Mar 2022 16:24:42 +0100 Subject: [PATCH] Add AddLinked to MapEntity MapEntity.linkedTo is readonly and arrives as a table on lua side, making it impossible to add new Links. Introducing AddLinked as an Addition makes it possible to link things. --- .../SharedSource/Lua/LuaBarotraumaAdditions.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaBarotraumaAdditions.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaBarotraumaAdditions.cs index 9beec97ae..756eba466 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaBarotraumaAdditions.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaBarotraumaAdditions.cs @@ -90,6 +90,14 @@ namespace Barotrauma } } + abstract partial class MapEntity + { + public void AddLinked(MapEntity entity) + { + linkedTo.Add(entity); + } + } + } namespace Barotrauma.Items.Components @@ -103,4 +111,4 @@ namespace Barotrauma.Items.Components partial struct Signal { } -} \ No newline at end of file +}