Closed ReturnEnd closed 7 years ago
Hi, as you can see at https://github.com/Patcher56/PatchProtect/blob/9b83f274fd2ded9f5f7eef6d1f9334c3b4a092ca/lua/patchprotect/server/propprotection.lua#L89 the function sv_pprotect.CanTouch only returns nil, if the player is allowed to touch the prop, if it is an admin or if he is the owner or buddy of the owner of the prop. If we would return true here, every further check by the hook "PhysgunPickup" would be ignored.
I have not the CPPI-reference in mind, but if we would be forced to return true or false, a simple or true
would fix the problem.
EDIT: It actually is, so I will change it.
Should be fixed with https://github.com/Patcher56/PatchProtect/commit/8b6b63975d4f9969e68c7accb09ff2e3f18cd9e4, but feel free to report any further issues.
Thanks for fixing it; but the code you implemented doesn't seem to be working in Lua ( I know it is in JAVA :) ) see http://lua-users.org/wiki/TernaryOperator
Fixed it : https://github.com/Patcher56/PatchProtect/compare/master...ReturnEnd:patch-2
Haha, I've checked the internet for the ternary operator, but it seems that I've gone through the post too fast. This operator is not only used in Java, it's used in C and some other languages too :D
But thanks for fixing the if conditions.
The function CPPICanPhysgun returns nil even when someone is able to pick up the prop. https://github.com/Patcher56/PatchProtect/blob/9b83f274fd2ded9f5f7eef6d1f9334c3b4a092ca/lua/autorun/cppi.lua#L87