MattJeanes / PewPew

Divran's old GCombat remake now up to date for Garry's Mod 13.
7 stars 9 forks source link

Fix reload commands for rcon #48

Closed brandonsturgeon closed 5 years ago

brandonsturgeon commented 5 years ago

Currently when using either of the reload commands from rcon, these checks err because, of course ply isn't valid when checking ply:IsSuperAdmin()

Reversing the checks should fix this issue by short circuiting before checking for ply:IsSuperAdmin()

Another option could be if ply:IsValid() and ply:IsSuperAdmin() or not ply:isValid() but that reads worse in my opinion.

Credit goes to https://github.com/PLally for making the change on our fork, I just thought I'd replicate it over here for ya.

Will update this PR when I confirm that this doesn't break all of the weapons again :p

brandonsturgeon commented 5 years ago
Screen Shot 2019-08-01 at 3 26 18 PM

The command appears to work from rcon and my players are saying PewPew is functional

MattJeanes commented 5 years ago

Yep good call makes sense. I'll try out that fix for the example bullet error too while testing this tomorrow hopefully

MattJeanes commented 5 years ago

Thanks, all looks good. By the way I found the issue with the previous *.lua thing:

https://github.com/MattJeanes/PewPew/commit/25e79ccd57f4074460b9d8e1fa44ea62acf0693b