{"action":"created","issue":{"url":"https://api.github.com/repos/Facepunch/garrysmod-issues/issues/3463","repository_url":"https://api.github.com/repos/Facepunch/garrysmod-issues","labels_url":"https://api.github.com/repos/Facepunch/garrysmod-issues/issues/3463/labels{/name}","comments_url":"https://api.github.com/repos/Facepunch/garrysmod-issues/issues/3463/comments","events_url":"https://api.github.com/repos/Facepunch/garrysmod-issues/issues/3463/events","html_url":"https://github.com/Facepunch/garrysmod-issues/issues/3463","id":321002222,"number":3463,"title":"util.TraceLine and util.TraceHull filters do not work with non-sequential tables","user":{"login":"maximlahaxim","id":16690342,"avatar_url":"https://avatars3.githubusercontent.com/u/16690342?v=4","gravatar_id":"","url":"https://api.github.com/users/maximlahaxim","html_url":"https://github.com/maximlahaxim","followers_url":"https://api.github.com/users/maximlahaxim/followers","following_url":"https://api.github.com/users/maximlahaxim/following{/other_user}","gists_url":"https://api.github.com/users/maximlahaxim/gists{/gist_id}","starred_url":"https://api.github.com/users/maximlahaxim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximlahaxim/subscriptions","organizations_url":"https://api.github.com/users/maximlahaxim/orgs","repos_url":"https://api.github.com/users/maximlahaxim/repos","events_url":"https://api.github.com/users/maximlahaxim/events{/privacy}","received_events_url":"https://api.github.com/users/maximlahaxim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-08T00:23:20Z","updated_at":"2018-05-22T10:05:27Z","closed_at":null,"author_association":"NONE","body":"When calling util.TraceLine or util.TraceHull, non-sequential filter tables don't work. Here's the code that I used, with g_nonBotBreakables and g_nonBotDoors being tables that are filled with entindexes as keys and their corresponding entities as values.\r\n```\r\nfunction TestTraces( type )\r\n\tlocal player = Entity( 1 )\r\n\tlocal aim = player:GetAimVector()\r\n\taim.z = 0.0\r\n\tlocal tr =\r\n\t{\r\n\t\tmins = Vector( 0, 0, -16 ),\r\n\t\tmaxs = VEC_HALFHUMAN, -- defined as Vector( 0, 0, 36 ), never changes\r\n\t\tstart = player:GetPos() + VEC_HALFHUMAN,\r\n\t\tendpos = (player:GetPos() + VEC_HALFHUMAN) + aim * 500.0,\r\n\t\tmask = MASK_ALL,\r\n\t\tignoreworld = true,\r\n\t\tfilter = (type == true) and g_nonBotBreakables or g_nonBotDoors\r\n\t}\r\n\tlocal result = util.TraceHull( tr )\r\n\tprint( result.Entity )\r\n\tprint( ((type == true) and g_nonBotBreakables or g_nonBotDoors)[ result.Entity:EntIndex() ] )\r\nend\r\n```\r\nIn theory, this code should never, _ever_ print that the filter table chosen by \"type\" has the hit entity's entindex inside it. However, upon calling this function with \"true\" and hitting a prop_door_rotating (an entity that isn't inside g_nonBotBreakables), the console prints the following:\r\n```\r\nEntity [147][prop_door_rotating] -- the entity\r\nEntity [147][prop_door_rotating] -- the entity in the filter table (which shouldn't have been hit)\r\n```"},"comment":{"url":"https://api.github.com/repos/Facepunch/garrysmod-issues/issues/comments/390936091","html_url":"https://github.com/Facepunch/garrysmod-issues/issues/3463#issuecomment-390936091","issue_url":"https://api.github.com/repos/Facepunch/garrysmod-issues/issues/3463","id":390936091,"user":{"login":"mcNuggets1","id":18447482,"avatar_url":"https://avatars3.githubusercontent.com/u/18447482?v=4","gravatar_id":"","url":"https://api.github.com/users/mcNuggets1","html_url":"https://github.com/mcNuggets1","followers_url":"https://api.github.com/users/mcNuggets1/followers","following_url":"https://api.github.com/users/mcNuggets1/following{/other_user}","gists_url":"https://api.github.com/users/mcNuggets1/gists{/gist_id}","starred_url":"https://api.github.com/users/mcNuggets1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcNuggets1/subscriptions","organizations_url":"https://api.github.com/users/mcNuggets1/orgs","repos_url":"https://api.github.com/users/mcNuggets1/repos","events_url":"https://api.github.com/users/mcNuggets1/events{/privacy}","received_events_url":"https://api.github.com/users/mcNuggets1/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T10:05:27Z","updated_at":"2018-05-22T10:05:27Z","author_association":"NONE","body":"This is not an issue tbh"}}
{"actor":{"display_login":"mcNuggets1"}}