-
Notifications
You must be signed in to change notification settings - Fork 38
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
Make CPPI functions obey settings #342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a closer look, I understand where you're coming from: none of these functions take toggle
into account because that check is done in the FPP.Protect
functions. That's a good find!
I did find a problem about the unghosting though. Would it be an idea to separately check for the toggle
setting, and then still use FPP.plyCanTouchEnt
?
This will look like a hardcoded fix since it won't take other settings into account. |
True, but it looks like those other settings are not what we want. The gravgun punting function, for example, may drop the prop. This makes sense to do on the hook, but not so much in the CPPI function |
I can add more additional checks, or just use the hardcoded fix, since this is already enough for me, but may not be enough for others. |
Now I think I have taken into account everything that is necessary. If you think I am wrong, then let me know. |
Hmm, I think the I've pushed a commit to propose an alternative: just check the toggle setting, but then still just use |
@@ -564,6 +566,7 @@ hook.Add("CanProperty", "FPP.Protect.CanProperty", FPP.Protect.CanProperty) | |||
|
|||
function FPP.Protect.CanDrive(ply, ent) | |||
-- Use Toolgun because I'm way too lazy to make a new type | |||
if not tobool(FPP.Settings.FPP_TOOLGUN1.toggle) then return true end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three fix a different bug: apparently editing variables/properties/driving also used toolgun settings, even if toolgun settings were disabled.
Okay, it looks like it can't break anything and that's good enough for me. Sorry for the late reply, my PC broke this week |
Sweet! |
Modifies CPPI functions to make them work more correctly. For example, this fixes returning false in CPPICanDamage when damage protection is disabled.