Prevent creating two tools with the same identifier in tools.allocate

This commit is contained in:
jacob1
2024-12-12 23:56:25 -05:00
parent 3e2fc0b31f
commit 6e43882a0e

View File

@@ -24,6 +24,10 @@ static int allocate(lua_State *L)
}
auto *lsi = GetLSI();
auto identifier = group + "_TOOL_" + name;
if (lsi->gameModel->GetToolFromIdentifier(identifier))
{
return luaL_error(L, "Tool identifier already in use.");
}
{
SimTool tool;
tool.Identifier = identifier;