mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
Upload
This commit is contained in:
49
gamemodes/base/entities/effects/base.lua
Normal file
49
gamemodes/base/entities/effects/base.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Returns the right shoot start position for a tracer - based on 'data'.
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:GetTracerShootPos( Position, Ent, Attachment )
|
||||
|
||||
self.ViewModelTracer = false
|
||||
|
||||
if ( !IsValid( Ent ) ) then return Position end
|
||||
if ( !Ent:IsWeapon() ) then return Position end
|
||||
|
||||
-- Shoot from the viewmodel
|
||||
if ( Ent:IsCarriedByLocalPlayer() && !LocalPlayer():ShouldDrawLocalPlayer() ) then
|
||||
|
||||
local ViewModel = LocalPlayer():GetViewModel()
|
||||
|
||||
if ( ViewModel:IsValid() ) then
|
||||
|
||||
local att = ViewModel:GetAttachment( Attachment )
|
||||
if ( att ) then
|
||||
Position = att.Pos
|
||||
self.ViewModelTracer = true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Shoot from the world model
|
||||
else
|
||||
|
||||
local att = Ent:GetAttachment( Attachment )
|
||||
if ( att ) then
|
||||
Position = att.Pos
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return Position
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user