Skip to content

Commit fd9ec2a

Browse files
committed
Don't drop entity if it was done in CPPI function
1 parent 47d1af8 commit fd9ec2a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/fpp/server/core.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function FPP.Protect.GravGunPickup(ply, ent, internal)
223223
end
224224

225225
if cantouch and not internal and FPP.UnGhost then FPP.UnGhost(ply, ent) end
226-
if cantouch == false then DropEntityIfHeld(ent) end
226+
if cantouch == false and not internal then DropEntityIfHeld(ent) end
227227
end
228228
hook.Add("GravGunOnPickedUp", "FPP.Protect.GravGunPickup", FPP.Protect.GravGunPickup)
229229

@@ -255,7 +255,7 @@ function FPP.Protect.GravGunPunt(ply, ent, internal)
255255
-- Do not reason further if gravgun protection is disabled.
256256
if not tobool(FPP.Settings.FPP_GRAVGUN1.toggle) then return end
257257

258-
if not IsValid(ent) then DropEntityIfHeld(ent) return end
258+
if not IsValid(ent) then if not internal then DropEntityIfHeld(ent) end return end
259259

260260
local cantouch
261261
local skipReturn = false
@@ -272,7 +272,7 @@ function FPP.Protect.GravGunPunt(ply, ent, internal)
272272
end
273273

274274
if cantouch and not internal and FPP.UnGhost then FPP.UnGhost(ply, ent) end
275-
if not cantouch then DropEntityIfHeld(ent) end
275+
if not cantouch and not internal then DropEntityIfHeld(ent) end
276276
if not cantouch and not skipReturn then return false end
277277
end
278278
hook.Add("GravGunPunt", "FPP.Protect.GravGunPunt", FPP.Protect.GravGunPunt)

0 commit comments

Comments
 (0)