diff --git a/lua/entities/gmod_tardis/modules/sh_redecorate.lua b/lua/entities/gmod_tardis/modules/sh_redecorate.lua index fec61ed37..3dc55fa63 100644 --- a/lua/entities/gmod_tardis/modules/sh_redecorate.lua +++ b/lua/entities/gmod_tardis/modules/sh_redecorate.lua @@ -88,17 +88,21 @@ if SERVER then ENT:AddHook("StopDemat", "redecorate_remove_parent", function(self) if self:GetData("redecorate") then - local child = self:GetData("redecorate_child") - if IsValid(child) then - child:SetData("redecorate_parent", nil, true) + if self:GetData("redecorate_pending_remove") then + local child = self:GetData("redecorate_child") + if IsValid(child) then + child:SetData("redecorate_parent", nil, true) + end + self:Remove() + else + self:SetData("redecorate_pending_remove", true) end - self:Remove() end end) ENT:AddHook("MatStart", "redecorate_sync", function(self) local parent = self:GetData("redecorate_parent") - if not parent then return end + if not IsValid(parent) then return end parent:ForcePlayerDrop() self:SetCollisionGroup(COLLISION_GROUP_WORLD) @@ -106,6 +110,18 @@ if SERVER then self:SetAngles(parent:GetAngles()) parent:SetParent(self) self:SetData("is_redecorate_child", true, true) + if parent:GetData("redecorate_pending_remove") then + parent:Remove() + self:SetData("redecorate_parent", nil, true) + else + parent:SetData("redecorate_pending_remove", true) + end + end) + + ENT:AddHook("CanMat", "redecorate", function(self) + if self:GetData("redecorate") then + return false + end end) ENT:AddHook("StopMat", "redecorate_sync", function(self) @@ -163,7 +179,7 @@ if SERVER then local phys = self:GetPhysicsObject() constraint.RemoveAll(parent) -- drop everything attached - parent:SetFastRemat(true) + parent:SetFastRemat(true, true) parent:SetPhyslock(true) parent:ForcePlayerDrop() @@ -175,7 +191,7 @@ if SERVER then parent:SetData("redecorate_mat_started", true) phys:Wake() - self:SetFastRemat(true) + self:SetFastRemat(true, true) self:Mat() local ply = self:GetCreator() diff --git a/lua/entities/gmod_tardis/modules/teleport/sh_tp_vortex.lua b/lua/entities/gmod_tardis/modules/teleport/sh_tp_vortex.lua index fb8aa6911..7bfab709d 100644 --- a/lua/entities/gmod_tardis/modules/teleport/sh_tp_vortex.lua +++ b/lua/entities/gmod_tardis/modules/teleport/sh_tp_vortex.lua @@ -22,8 +22,8 @@ function ENT:ToggleFastRemat() return self:SetFastRemat(on) end -function ENT:SetFastRemat(on) - if self:CallHook("CanToggleFastRemat") == false then +function ENT:SetFastRemat(on, force) + if (not force) and (self:CallHook("CanToggleFastRemat") == false) then return false end diff --git a/lua/tardis/controls/sh_control_hads.lua b/lua/tardis/controls/sh_control_hads.lua index f099109bb..47803a2de 100644 --- a/lua/tardis/controls/sh_control_hads.lua +++ b/lua/tardis/controls/sh_control_hads.lua @@ -1,7 +1,8 @@ TARDIS:AddControl({ id = "hads", ext_func=function(self,ply) - TARDIS:StatusMessage(ply, "Controls.HADS.Status", self:ToggleHADS()) + self:ToggleHADS() + TARDIS:StatusMessage(ply, "Controls.HADS.Status", self:GetHADS()) end, serveronly=true, power_independent = false, diff --git a/lua/tardis/settings/sh_global_settings.lua b/lua/tardis/settings/sh_global_settings.lua index 7816642c8..ad6ef9ce8 100644 --- a/lua/tardis/settings/sh_global_settings.lua +++ b/lua/tardis/settings/sh_global_settings.lua @@ -154,7 +154,7 @@ TARDIS:AddSetting({ TARDIS:AddSetting({ id="admin_security_bypass", type="bool", - value=true, + value=false, class="global", convar = {