TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
179 stars 77 forks source link

Fix weapon pickup through walls #1662

Closed MrXonte closed 1 month ago

MrXonte commented 1 month ago

Add check for trace start solid to prevent teleporting weapon through walls.

Edgecases can occur where weapons can be picked up through walls (even thick 16 unit walls didn't prevent this). This is because the trace can start solid (most likely if the weapon is too large for the space its resting, in my case a relatively small func_detail shelf) and then the tr.Fraction will return 1.0 through a solid wall, causing weapons the be teleported and picked up.

TimGoll commented 1 month ago

What a nice catch, wow! This was probably mostly an error when auto pickup is enabled, am I right?

Could you please add yourself to the changelog?

MrXonte commented 1 month ago

Yep! Absolutely no issue without auto pickup since you cant select the weapons through walls, unfortunately people were raiding my traitor room on my current mapping project with auto pickup. Added myself to the changelog :)