Skip to content
This repository was archived by the owner on Mar 11, 2021. It is now read-only.

Commit b5039dc

Browse files
committed
BulletGhost Exploit fix
Now BulletGhost is really client side - Removed useless checks before GiveGhostWeapons()
1 parent 890b1cd commit b5039dc

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Diff for: lua/sv_specdm_overrides.lua

+1-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ hook.Add("PlayerSpawn", "PlayerSpawn_SpecDM", function(ply)
4747
if ply:IsGhost() then
4848
ply.has_spawned = true
4949
ply:UnSpectate()
50-
if IsValid(ply) and ply:IsGhost() and ply:GetWeapons() == nil then
51-
ply:GiveGhostWeapons()
52-
end
50+
ply:GiveGhostWeapons()
5351
hook.Call("PlayerSetModel", GAMEMODE, ply)
5452
end
5553
end)

Diff for: lua/weapons/weapon_ghost_base.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ if CLIENT then
3535
-- This sets the icon shown for the weapon in the DNA sampler, search window,
3636
-- equipment menu (if buyable), etc.
3737
SWEP.Icon = "vgui/ttt/icon_nades" -- most generic icon I guess
38+
39+
net.Receive("SpecDM_BulletGhost", function()
40+
local str = net.ReadString()
41+
local vector = net.ReadVector()
42+
local num = net.ReadUInt(19)
43+
if num == 0 then num = nil end
44+
sound.Play(str, vector, num)
45+
end)
3846

3947
-- You can make your own weapon icon using the template in:
4048
-- /garrysmod/gamemodes/terrortown/template/
@@ -250,14 +258,6 @@ function SWEP:PrimaryAttack(worldsnd)
250258
owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) * self.Primary.Recoil, 0 ) )
251259
end
252260

253-
net.Receive("SpecDM_BulletGhost", function()
254-
local str = net.ReadString()
255-
local vector = net.ReadVector()
256-
local num = net.ReadUInt(19)
257-
if num == 0 then num = nil end
258-
sound.Play(str, vector, num)
259-
end)
260-
261261
function SWEP:DryFire(setnext)
262262
if CLIENT and LocalPlayer() == self.Owner then
263263
self:EmitSound( "Weapon_Pistol.Empty" )

0 commit comments

Comments
 (0)