changes to client-side commands and added some physics related things

This commit is contained in:
Evil Factory
2021-10-07 11:46:57 -03:00
parent 33f74c4a73
commit 578bba38a2
4 changed files with 52 additions and 12 deletions
@@ -3097,20 +3097,38 @@ namespace Barotrauma
}
});
commands.Add(new Command("lua_cl", "lua_cl: runs a string on the client", (string[] args) =>
commands.Add(new Command("cl_lua", "lua_cl: runs a string on the client", (string[] args) =>
{
if (GameMain.Client != null)
GameMain.Lua.DoString(string.Join(" ", args));
else
ThrowError("Client not connected to any server.");
if (GameMain.Client == null)
{
ThrowError("Client not connected to a server.");
return;
}
if (!GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands))
{
ThrowError("Command not permitted.");
return;
}
GameMain.Lua.DoString(string.Join(" ", args));
}));
commands.Add(new Command("reloadlua_cl", "reloads lua on the client", (string[] args) =>
commands.Add(new Command("cl_reloadlua", "reloads lua on the client", (string[] args) =>
{
if (GameMain.Client != null)
GameMain.Lua.Initialize();
else
ThrowError("Client not connected to any server.");
if (GameMain.Client == null)
{
ThrowError("Client not connected to a server.");
return;
}
if (!GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands))
{
ThrowError("Command not permitted.");
return;
}
GameMain.Lua.Initialize();
}));
}