Skip to content

CanEntityBeHostile

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void CanEntityBeHostile( BaseCombatEntity instance )
{
    Puts( "CanEntityBeHostile works!" );
}
csharp
private void CanEntityBeHostile( BasePlayer instance )
{
    Puts( "CanEntityBeHostile works!" );
}

Location

  • BaseCombatEntity::IsHostile()
  • BasePlayer::IsHostile()
csharp
public virtual bool IsHostile()
{
	object returnvar = Interface.CallHook("CanEntityBeHostile", this);
	if (returnvar is bool)
	{
		return (bool)returnvar;
	}
	return this.unHostileTime > Time.realtimeSinceStartup;
//---
csharp
public override bool IsHostile()
{
	object returnvar = Interface.CallHook("CanEntityBeHostile", this);
	if (returnvar is bool)
	{
		return (bool)returnvar;
	}
	return this.State.unHostileTimestamp > TimeEx.currentTimestamp;
//---

Released under the MIT License.