Clamped physgun color to above 0 #1061

Merged
merged 1 commit into from Sep 23, 2015

Projects

None yet

5 participants

@0tt
Contributor
0tt commented Sep 20, 2015

Fixes an exploit where beams would become invisible (minges use this).
Alternative for legitimate uses:

@0tt 0tt Clamped physgun color to above 0
Fixes an exploit where beams would become invisible (minges use this). 
Alternative for legitimate uses:
![](http://i.imgur.com/IaXoWFV.png)
76ccdcb
@Velkon
Contributor
Velkon commented Sep 20, 2015

no

@Acecool
Contributor
Acecool commented Sep 20, 2015

One note, you shouldn't need self.Player just like you don't need self.Entity in the Player ( or entity ) meta-tables. Those exceptions are actually hard-coded into the meta-table __index / __newindex functions because so many people still use them, but new code should avoid using those deprecated calls.

There should probably also be an admin exception ( I personally set physgun color to black, ie invisible, for admins that are invisible to prevent an orb from appearing ) or a convar to control if admins or super-admins override that behavior.

And, another note: Physgun beam and dot can sometimes get in the way of placing objects that are small so being able to set it to invisible is beneficial to players as well.

@willox
Collaborator
willox commented Sep 20, 2015

One note, you shouldn't need self.Player just like you don't need self.Entity in the Player ( or entity ) meta-tables. Those exceptions are actually hard-coded into the meta-table __index / __newindex functions because so many people still use them, but new code should avoid using those deprecated calls.

This is how player classes work. That means you need it in this instance.

@0tt
Contributor
0tt commented Sep 20, 2015

There should probably also be an admin exception ( I personally set physgun color to black, ie invisible, for admins that are invisible to prevent an orb from appearing ) or a convar to control if admins or super-admins override that behavior.

This only affects the convar, not SetWeaponColor.

And, another note: Physgun beam and dot can sometimes get in the way of placing objects that are small so being able to set it to invisible is beneficial to players as well.

@robotboy655 robotboy655 merged commit 8911620 into garrynewman:master Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment