CanBeTargeted hook being called for scientistsFixed
Not sure if this is intentional or not but the peacekeeper turrets in the outpost are causing the CanBeTargeted hook to be called about 10000 times per second.
I Noticed this while trying to find causes of lag within some plugins. The fact that scientists cause this hook to be called could be considered a feature but if so would probably be better to be left to a seperate hook and not in the player hook.
How are you using the hook exactly? There is no support for HTNPlayer yet (the newer NPC type in Rust), but NPCPlayerApex and the older NPC types are supported.
In response to Wulf ():
How are you using the hook exactly? There is no support for HTNPlayer yet (the newer NPC type in Rus...
It's not a plugin I write, just the canBeTargeted hook for BasePlayer, AutoTurret since scientists are a subclass of BasePlayer, so the Outpost turrets are constantly targetting the scientists and then the hook is getting called before the check if it's a NPC.

Oh right, the hook is BaseEntity, being cast to BasePlayer with as, so it's not specifically BasePlayer then. Confused it with the other canBeTargeted hooks from flameturret and guntrap
Hooks are called as frequently as the game triggers them.
Yeah i get that. But being called more often than onTick seems kinda out of control
Locked automatically