Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lua/weapons/gmod_tool/stools/advdupe2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@
for _, target in pairs(system) do
for x = 1, 4 do
if v.Entity[x] then
for y = 1, 4 do
if target.Entity[y] and v.Entity[x].Index == target.Entity[y].Index then
system[#system + 1] = v
if #system == 100 then
fullSystems[#fullSystems + 1] = system
table.remove(sortingSystems, systemi)
end
input[k] = nil
goto super_loopbreak
end
end

Check warning on line 65 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Scope depth"

Are you Egyptian? What's with these fucking scope pyramids!?
end
end
end
Expand Down Expand Up @@ -471,10 +471,10 @@
local min
local max
if(not delay) then
delay = tonumber(GetConVarString("AdvDupe2_MinContraptionSpawnDelay")) or 0.2

Check warning on line 474 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
else
if(not game.SinglePlayer()) then
min = tonumber(GetConVarString("AdvDupe2_MinContraptionSpawnDelay")) or 0.2

Check warning on line 477 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
if (delay < min) then
delay = min
end
Expand All @@ -484,11 +484,11 @@
end

if(not undo_delay) then
undo_delay = tonumber(GetConVarString("AdvDupe2_MinContraptionUndoDelay"))

Check warning on line 487 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
else
if(not game.SinglePlayer()) then
min = tonumber(GetConVarString("AdvDupe2_MinContraptionUndoDelay")) or 0.1

Check warning on line 490 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
max = tonumber(GetConVarString("AdvDupe2_MaxContraptionUndoDelay")) or 60

Check warning on line 491 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
if(undo_delay < min) then
undo_delay = min
elseif(undo_delay > max) then
Expand Down Expand Up @@ -578,12 +578,12 @@
if not ply:CheckLimit("gmod_contr_spawners") then return nil end

if(not game.SinglePlayer()) then
if(table.Count(EntityTable)>tonumber(GetConVarString("AdvDupe2_MaxContraptionEntities"))) then

Check warning on line 581 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
AdvDupe2.Notify(ply,"Contraption Spawner exceeds the maximum amount of "..GetConVarString("AdvDupe2_MaxContraptionEntities").." entities for a spawner!",NOTIFY_ERROR)

Check warning on line 582 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
return false
end
if(#ConstraintTable>tonumber(GetConVarString("AdvDupe2_MaxContraptionConstraints"))) then

Check warning on line 585 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
AdvDupe2.Notify(ply,"Contraption Spawner exceeds the maximum amount of "..GetConVarString("AdvDupe2_MaxContraptionConstraints").." constraints for a spawner!",NOTIFY_ERROR)

Check warning on line 586 in lua/weapons/gmod_tool/stools/advdupe2.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
return false
end
end
Expand Down Expand Up @@ -853,7 +853,10 @@
if(not file.IsDir("advdupe2_maps", "DATA")) then
file.CreateDir("advdupe2_maps")
end
file.Write("advdupe2_maps/"..args[1]..".txt", data)

local savename = args[1] or game.GetMap() .. "_" .. util.DateStamp()
file.Write("advdupe2_maps/" .. savename .. ".txt", data)

AdvDupe2.Notify(ply, "Map save, saved successfully.")
end)
end)
Expand Down
Loading