-
Notifications
You must be signed in to change notification settings - Fork 6
dont allow non-admins to propify themselves in pvp #176
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
Conversation
lua/ulx/modules/sh/cfc_propify.lua
Outdated
| ULib.tsayError( caller, ulx.getExclusive( ply, caller ), true ) | ||
| elseif not ply:Alive() then | ||
| ULib.tsayError( caller, ply:Nick() .. " is dead and cannot be propified!", true ) | ||
| elseif ( ply.IsInPvp and ply:IsInPvp() ) and not caller:IsAdmin() then |
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.
This is going to prevent moderators from using the command on pvpers, im not sure thats desired.
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.
if you want to go ahead with your idea of an spropify command then maybe it would be better to drop the check here and add it to that command instead.
plally
left a comment
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.
This looks good, great job.
lua/ulx/modules/sh/cfc_propify.lua
Outdated
| for _, ply in pairs( targets ) do | ||
| if ply.ragdoll then ply.ragdoll:CPPISetOwner( ply ) end | ||
| 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.
If this is meant to resolve the issue of explosive models allowing builders to kill pvpers, thus opening the command for non-staff usage, this should be moved to the base command.
I'll also mention that this would allow players to manipulate their prop self with chips, which could lead to some wacky stuff but shouldn't cause any problems. Would be fun to see, honestly.
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.
i think its just to allow builders to do funny stuff with the command.
Would probably need to have the owner set to the caller instead if its applied to the normal command.
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.
If this is meant to resolve the issue of explosive models allowing builders to kill pvpers, thus opening the command for non-staff usage, this should be moved to the base command.
I believe explosive models can already kill pvpers, regardless of who they are owned by. This was mainly to allow prop manipulation with chips, and also grant prop protection buddies the ability to physgun/toolgun the prop.
Would probably need to have the owner set to the caller instead if its applied to the normal command.
I have moved this call to propifyPlayer and changed the owner to be the caller rather than the target.
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.
Explosion damage from props will be attributed to (and thus check pvp status of) whoever dealt damage to the prop last, and fallback to :CPPIGetOwner() if no damage was dealt.
Testing in p2p, this all works fine, preventing build abuse... except for when the prop explodes by impacting the pvper's body. In such a case, the prop takes physics damage from the pvper, causing the explosion attacker to be the pvper, and thus letting the damage go unblocked and counting as a suicide in the killfeed.
Granted, this can already be abused by builders without needing to use this command, so it would be best solved by having cfc_pvp block DMG_BLAST damage when the inflictor is a builder-owned, non-player entity. No further changes needed in this pr.
- These calls are redundant, as prop deletion is already handled by propify. - DisallowDeleting also enforces a toolgun whitelist on the affected prop, which is undesired behavior.
The command now no longer works if the target of the command is in pvp mode and the caller is not an admin.