EntityHurt for SleepingBag/Bed

CalypsoToolz

New Member
Member
Oct 16, 2016
6
0
1
32
Russia, Kirov region, Yaransk
Hello, people! I encountered a problem: I can not keep track of damage inflicted on a sleeping bag/bed in Fougerite.Hooks.EntityHurt method, try logging:
C#:
public static void EntityHurt(object entity, ref DamageEvent e) {
            Logger.Log("EntityHurt is work!");
                        ...
}
This method worked success for all deployable/struct object, but for sleepingBag/bed not work, why? although this items is deployable
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
In the Assembly it is a deployable, So not sure why is not being triggered by EntityHurt event.
try some debugging, Maybe On_NPCHurt may call it?
C#:
public void EntityHurt(object entity, DamageEvent e) {
    Logger.Log("EntityHurt is work!");
    Logger.Log("Item name: " + entity.Name);
    if (entity.IsDeployableObject())
    {
        Logger.Log("Item is a deployable");
    }
}
 

CalypsoToolz

New Member
Member
Oct 16, 2016
6
0
1
32
Russia, Kirov region, Yaransk
In the Assembly it is a deployable, So not sure why is not being triggered by EntityHurt event.
try some debugging, Maybe On_NPCHurt may call it?
C#:
public void EntityHurt(object entity, DamageEvent e) {
    Logger.Log("EntityHurt is work!");
    Logger.Log("Item name: " + entity.Name);
    if (entity.IsDeployableObject())
    {
        Logger.Log("Item is a deployable");
    }
}
While attacking bag On_NPCHurt not called