-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trace filters inverted behavior? #1826
Comments
The trace filter behavior hasn't been touched. Do you have a better code example? |
This is the actual trace that is using the above filter.
This code worked before I updated earlier today. |
I tested with this and it seems to work fine. --@server
local owner = owner()
hook.add("think","",function()
local start = owner:getShootPos()
local tr = trace.line(start, start+owner:getAimVector()*10000,
function(e) return e~=owner end)
print(tr.Entity)
end) |
I did neglect to mention that my code is running client side. Just tested it with your above code and it seems like getOwner() doesnt function clientside anymore. It returns nothing, even when just checking the trace hit ent. |
Seem like a CPPI issue, check what cppi addon you use. It's possible that the one you use doesn't specify ownership of props client side or you call :getOwner() before client know the owner. |
It does sound like a prop protection issue. I don't the SF has changed anything regarding prop protection in a long time. |
I'll give it a try using my prop protection sometime later. |
Im using Nadmod Prop Protection, which itself hasant been updated in awhile. |
I just had a problem similar to this, although it's more like "filters not working in specific cases." It seems filtering players has stopped working? Specifically, filtering for a player entity does not work, but filtering for a table with a player or players in it does. |
This should fix the entity table issue #1832 |
I just tested this and didn't have any problem --@client
local owner = owner()
local chip = chip()
hook.add("think","",function()
local start = owner:getShootPos()
local tr = trace.line(start, start+owner:getAimVector()*10000, function(e)
return e~=owner and e:getOwner()~=owner
end)
print(tr.Entity)
end) |
The whole point of my original code was to AVOID tracing objects owned by myself. The above code fails to do that because getOwner() no longer seems to work client side.
This code should return owner, however it returns nil, at least on my machine. |
https://github.com/thegrb93/StarfallEx/blob/master/lua/starfall/libs_sh/entities.lua#L102 Maybe you have disabled the permission? |
It works for me with and without nadmod pp.
That wouldn't affect anything. I'm not even sure why that if check is there. |
Try updating your version of nadmodpp, it works fine for me. |
Just updated starfall today and noticed that the behavior on all my trace functions has been inverted.
Once where i used
local function filter(ent) return ent:getOwner() != owner() end
I now have to use
local function filter(ent) return ent:getOwner() == owner() end
I would like to know if this behavior is intentional or not before I go update all the instances of this in my scripts.
To clarify, the behavior I would like is to not hit entities owned by me.
The text was updated successfully, but these errors were encountered: