Skip to content
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

sh_0_ttt.lua: don't override existing SWEP.Icon #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RalphORama
Copy link

I ran into an issue while recreating the default TTT SWEPs with ArcCW: the current code overrides SWEP.Icon no matter what.

In my use case, I had copied over SWEP.Icon = "vgui/ttt/icon_silenced", but this was being overwritten to wep.Icon = "arccw/hud/arccw_bird.png" since icon_silenced didn't match the SWEP ClassName of weapon_ttt_sipistol.

I think this solution is the most elegant - only attempt to automatically override the icon if it isn't already set. We check isstring() first because Material() requires a string for an argument (if we pass nil we get an error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant