mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-20 07:01:27 +02:00
Prevent creating two tools with the same identifier in tools.allocate
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user