Skip to content

OnEntityMarkHostile

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnEntityMarkHostile( BaseCombatEntity instance, float duration )
{
    Puts( "OnEntityMarkHostile works!" );
    return null;
}
csharp
private object OnEntityMarkHostile( BasePlayer instance, float duration )
{
    Puts( "OnEntityMarkHostile works!" );
    return null;
}

Location

  • BaseCombatEntity::MarkHostileFor(float duration)
  • BasePlayer::MarkHostileFor(float duration)
csharp
public virtual void MarkHostileFor(float duration = 60f)
{
	if (Interface.CallHook("OnEntityMarkHostile", this, duration) == null)
	{
		float b = Time.realtimeSinceStartup + duration;
		unHostileTime = Mathf.Max(unHostileTime, b);
	}
}
csharp
public override void MarkHostileFor(float duration = 60f)
{
	if (Interface.CallHook("OnEntityMarkHostile", this, duration) == null && !IsHostilePaused())
	{
		double currentTimestamp = TimeEx.currentTimestamp;
		double val = currentTimestamp + (double)duration;
		State.unHostileTimestamp = Math.Max(State.unHostileTimestamp, val);
		DirtyPlayerState();
//---

Released under the MIT License.