Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedTail committed May 18, 2024
2 parents 3371a28 + 0d7bd8d commit c828818
Show file tree
Hide file tree
Showing 106 changed files with 5,938 additions and 814 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gluatest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: GLuaTest Runner

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workshop-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Upload to Workshop
uses: CFC-Servers/gmod-upload@master
with:
id: 3182725803
id: 3248769144
changelog: "${{ github.event.head_commit.message }}"
title: "[ACF-3] Armored Combat Framework"
type: "tool"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Ammunition is customizable with varying ballistic performance along with armor b
ACF Requires these to work

Wiremod ([Workshop](https://steamcommunity.com/workshop/filedetails/?id=160250458) or [Github](https://github.com/wiremod))
Contraption Framework ([Workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=3154971187) or [Github](https://github.com/ACF-Team/CFW))

Prop Protection with [CPPI](http://ulyssesmod.net/archive/CPPI_v1-3.pdf) is not required, but highly recommended. We'd recommend Nadmod PP ([Workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=159298542) or [Github](https://github.com/Nebual/NadmodPP)).

Expand Down
19 changes: 18 additions & 1 deletion lua/acf/ballistics/ballistics_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ function Ballistics.OnImpact(Bullet, Trace, Ammo, Type)
end
end

function Ballistics.TestFilter(Entity, Bullet)
if not IsValid(Entity) then return true end

if GlobalFilter[Entity:GetClass()] then return false end

if HookRun("ACF_OnFilterBullet", Entity, Bullet) == false then return false end

if Entity._IsSpherical then return false end -- TODO: Remove when damage changes make props unable to be destroyed, as physical props can have friction reduced (good for wheels)

return true
end

function Ballistics.DoBulletsFlight(Bullet)
if HookRun("ACF Bullet Flight", Bullet) == false then return end

Expand Down Expand Up @@ -260,7 +272,12 @@ function Ballistics.DoBulletsFlight(Bullet)
else
local Entity = traceRes.Entity

if GlobalFilter[Entity:GetClass()] then return end
if Ballistics.TestFilter(Entity, Bullet) == false then
table.insert(Bullet.Filter, Entity)
Ballistics.DoBulletsFlight(Bullet) -- Retries the same trace after adding the entity to the filter, important incase something is embedded in something that shouldn't be hit

return
end

local Type = Ballistics.GetImpactType(traceRes, Entity)

Expand Down
Loading

0 comments on commit c828818

Please sign in to comment.