Interface.CallHook("OnLootEntity", (object) this.GetComponent<BasePlayer>(), (object) targetEntity);can be improved and optimised to
Interface.CallHook("OnLootEntity", (object) this.baseEntity, (object) targetEntity);
P.S. You can check how EntityComponent works, which is base of PlayerLoot (PlayerLoot : EntityComponent<BasePlayer>)
public class EntityComponent<T> : EntityComponentBase where T : BaseEntity
{
[NonSerialized]
public T _baseEntity;
public T baseEntity
{
get
{
if ((UnityEngine.Object) this._baseEntity == (UnityEngine.Object) null)
this.UpdateBaseEntity();
return this._baseEntity;
}
}
protected void UpdateBaseEntity()
{
if (!(bool) (UnityEngine.Object) this || !(bool) (UnityEngine.Object) this.gameObject)
return;
this._baseEntity = this.gameObject.ToBaseEntity() as T;
}
protected override BaseEntity GetBaseEntity()
{
return (BaseEntity) this.baseEntity;
}