OnEntityVisibilityCheck
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private void OnEntityVisibilityCheck( BaseEntity ent, BasePlayer player, uint id, string debugName, float maximumDistance )
{
Puts( "OnEntityVisibilityCheck works!" );
}
Location
- BaseEntity/RPC_Server/IsVisible::Test(uint id, string debugName, BaseEntity ent, BasePlayer player, float maximumDistance)
csharp
//---
{
if (ent == null || player == null)
{
return false;
}
object returnvar = Interface.CallHook("OnEntityVisibilityCheck", ent, player, id, debugName, maximumDistance);
if (returnvar is bool)
{
return (bool)returnvar;
}
return GamePhysics.LineOfSight(player.eyes.center, player.eyes.position, 1218519041, null) && (ent.IsVisible(player.eyes.HeadRay(), 1218519041, maximumDistance) || ent.IsVisible(player.eyes.position, maximumDistance));
//---