I'm modifying a plugin that spawns special infected by picking several random spot near survivors, then fires TraceRay to check if there is a wall or obstacle between that spot and survivors.
However, when it comes to iron fence like those are near c2m1's motel or those surround c2m2's ticket booth, TraceRay still can't penetrate those fence, which lead to zombie spawning in sight.
Hence, if there any solution to get the entity's name that TraceRay hit so that iron fence could be an exception of none-line-of-sight?
PS 1. I've tried using
Code:
TR_GetEntityIndex()
and
Code:
GetEdictClassname()
, it only returns player(when TraceRay hit player) and worldspawn(hit any kind of wall or something).
PS 2. Method
Code:
GetEntProp(client, Prop_Send, "m_hasVisibleThreats")
seems impractical because it needs about 0.5~1 second to return the correct spawn state, which is not a reasonable solution in finding valid spot rapidly.
PS 3. I found this post talking almost exactly the same thing I encountered, so maybe TraceRay is kind of useless on this situation?
https://forums.alliedmods.net/showpo...15&postcount=6