Skip to content

Commit

Permalink
Merge pull request #923 from MattJeanes/dev
Browse files Browse the repository at this point in the history
2023.7.1
  • Loading branch information
MattJeanes authored Sep 18, 2023
2 parents 4e2ee87 + 9669be5 commit 39dae07
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
30 changes: 23 additions & 7 deletions lua/entities/gmod_tardis/modules/sh_redecorate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,40 @@ 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)
self:SetPos(parent:GetPos())
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)
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_tardis/modules/teleport/sh_tp_vortex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion lua/tardis/controls/sh_control_hads.lua
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/settings/sh_global_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ TARDIS:AddSetting({
TARDIS:AddSetting({
id="admin_security_bypass",
type="bool",
value=true,
value=false,

class="global",
convar = {
Expand Down

0 comments on commit 39dae07

Please sign in to comment.