-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fixed error when trying to drop ammo for weapons without AmmoEnt #1671
Conversation
i just noticed that AmmoEnt isnt default in the base anyway, but it seems quite a few addons do add it with = "". Guess the addons should update instead of TTT2 then |
Uhm, am I missing something or is your fix an actual valid fix?
|
Yea as per my comment i noticed that the issue is within addons, not TTT/TTT2 itself. A few addons use AmmoEnt = "" instead of just not setting AmmoEnt in SWEPS. If its not set the default code works perfectly fine, (due to the nil check) but if an Addon sets it to "", then it causes Errors. Should be the addon creators issue, that's why I closed the pull request, my bad |
Understood. But adding a failsafe check to TTT2 is perfectly reasonable in my opinion, even though the devs should set it to Imho your fix sounds like a good addition. @Histalek should voice his opinion as well I think |
Could you send us an example of such an error? As far as i can see we already check for invalid entity classes in this case, so i'm confused on how this could possibly lead to an error |
Ok i think i understand now. The So yeah this is a problem best solved on the individual swep addon side. However if [1] https://wiki.facepunch.com/gmod/ents.Create [2]
|
I've merged the check into our existing check and wrote a reasoning comment so we don't forget Thanks again @MrXonte for finding and fixing this! |
When trying to drop ammo on a weapon with no AmmoEnt (aka AmmoEnt = ""), an error appears in the console from trying to create a non-existent entity.