mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Add constraint limit from basegame (#482)
* Add constraint limit from basegame * Differentiate between rope and regular constraints * Remove print * Apply suggestions from code review Co-authored-by: thegrb93 <grbrown93@sbcglobal.net> * Add player check --------- Co-authored-by: thegrb93 <grbrown93@sbcglobal.net>
This commit is contained in:
parent
8a1fa8658f
commit
ac5f1f202a
@ -509,6 +509,7 @@ local function CreateConstraintFromTable(Constraint, EntityList, EntityTable, Pl
|
||||
local Factory = duplicator.ConstraintType[Constraint.Type]
|
||||
if not Factory then return end
|
||||
|
||||
if Player and not Player:CheckLimit( "constraints" ) then return end
|
||||
local first, firstindex -- Ent1 or Ent in the constraint's table
|
||||
local second, secondindex -- Any other Ent that is not Ent1 or Ent
|
||||
local Args = {} -- Build the argument list for the Constraint's spawn function
|
||||
@ -650,6 +651,10 @@ local function CreateConstraintFromTable(Constraint, EntityList, EntityTable, Pl
|
||||
return
|
||||
end
|
||||
|
||||
if Player then
|
||||
Player:AddCount( "constraints", Ent )
|
||||
end
|
||||
|
||||
Ent.BuildDupeInfo = table.Copy(buildInfo)
|
||||
|
||||
-- Move the entities back after constraining them. No point in moving the world though.
|
||||
|
Loading…
Reference in New Issue
Block a user