Fixing stuff part 1

This commit is contained in:
Evil Factory
2022-04-08 16:08:59 -03:00
parent f6241048c0
commit b37fd8d9c9
13 changed files with 27 additions and 171 deletions
@@ -1252,7 +1252,7 @@ namespace Barotrauma
commands.Add(new Command("install_cl_lua", "Installs client-Side Lua into your client.", (string[] args) =>
{
if (!File.Exists("Mods/LuaForBarotrauma/clientside_files.zip"))
if (!System.IO.File.Exists("Mods/LuaForBarotrauma/clientside_files.zip"))
{
GameMain.Server.SendChatMessage("clientside_files.zip doesn't exist, Github version?", ChatMessageType.ServerMessageBox);
@@ -83,47 +83,12 @@ namespace Barotrauma
return generic.Invoke(this, new object[]{comp, extraData });
}
}
partial class ItemPrefab
{
public static void AddToSpawnQueue(ItemPrefab itemPrefab, Vector2 position, object spawned = null)
{
EntitySpawner.Spawner.AddToSpawnQueue(itemPrefab, position, onSpawned: (Item item) =>
{
GameMain.Lua.CallFunction(spawned, new object[] { item });
});
}
public static void AddToSpawnQueue(ItemPrefab itemPrefab, Inventory inventory, object spawned = null)
{
EntitySpawner.Spawner.AddToSpawnQueue(itemPrefab, inventory, null, null, onSpawned: (Item item) =>
{
GameMain.Lua.CallFunction(spawned, new object[] { item });
});
}
}
}
namespace Barotrauma.Items.Components
{
using Barotrauma.Networking;
partial class CustomInterface
{
public void UpdateClients()
{
//notify all clients of the new state
GameMain.Server.CreateEntityEvent(item, new object[]
{
NetEntityEvent.Type.ComponentState,
item.GetComponentIndex(this)
});
item.CreateServerEvent(this);
}
}
partial struct Signal
{
public static Signal Create(string value, int stepsTaken = 0, Character sender = null, Item source = null, float power = 0.0f, float strength = 1.0f)