Skip to content

Commit

Permalink
Merge branch 'master' into hook-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thecraftianman committed Jan 6, 2024
2 parents 056bfe6 + e6d084a commit 8ed69c6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion lua/tests/acf/ballistics/ballistics_sv/get_impact_type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,24 @@ return {
name = "Returns Prop if impacting a Player Entity",
func = function()
local Trace = {}
local Entity = { IsPlayer = stub().returns( true ) }
local Entity = {
IsPlayer = stub().returns( true ),
IsNPC = stub().returns( false )
}

local Type = ACF.Ballistics.GetImpactType( Trace, Entity )
expect( Type ).to.equal( "Prop" )
end
},

{
name = "Returns Prop if impacting an NPC Entity",
func = function()
local Trace = {}
local Entity = {
IsPlayer = stub().returns( false ),
IsNPC = stub().returns( true )
}

local Type = ACF.Ballistics.GetImpactType( Trace, Entity )
expect( Type ).to.equal( "Prop" )
Expand All @@ -29,6 +46,7 @@ return {
local Trace = {}
local Entity = {
IsPlayer = stub().returns( false ),
IsNPC = stub().returns( false ),
CPPIGetOwner = function()
return { IsValid = stub().returns( true ) }
end
Expand All @@ -45,6 +63,7 @@ return {
local Trace = {}
local Entity = {
IsPlayer = stub().returns( false ),
IsNPC = stub().returns( false ),
CPPIGetOwner = function()
return { IsValid = stub().returns( false ) }
end
Expand Down

0 comments on commit 8ed69c6

Please sign in to comment.