Interior flag broke?

On a HB script, I wanted to have an undead take damage during day, take minor healing at night ONLY OUTDOORS. While testing, what happens is, since it is day, he takes damage interior or exterior. By the behavior, the 2 options are 1) It’s ignoring the “return”, or 2) It’s ignoring the toolset flag. If I change the check to:
if (!GetIsAreaInterior())
return;
It acknowledges the return and stops ALWAYS. It’s like it thinks ALL areas are outdoors. So it’s not just ignoring the return, it’s ignoring the toolset “interior” flag. I don’t get it. Anyone else have a similar problem?

void main()
{
effect eVFX;
effect eDamage;
object oSelf = OBJECT_SELF;

if (GetIsAreaInterior())
return;

if (GetIsDusk() || GetIsNight())
{
    // Cause healing.
eDamage = EffectDamage(1, DAMAGE_TYPE_NEGATIVE);
eVFX = EffectVisualEffect(VFX_IMP_HEALING_G);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oSelf);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX   , oSelf);
}

else if ( GetIsDawn()  ||  GetIsDay() )
{
    // Cause damage.
    eDamage = EffectDamage(d2(), DAMAGE_TYPE_POSITIVE);
    eVFX = EffectVisualEffect(VFX_COM_HIT_FIRE);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oSelf);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX   , oSelf);
}

}

Yar. :slight_smile: Switch that to

    if (GetIsAreaInterior(GetArea(oSelf)))

GetIsAreaInterior()'s default is OBJECT_INVALID.

Thanks man, that worked. I thought I had tried something similar but it must not have worked. I think I defined it like object oArea= OBJECT_SELF and then GetIsAreaInterior(oArea) or something like that.

1 Like