Page 1 of 1

0.13.5 - Possible bad interaction between guard reset on crime state clear and werewolf form [RESOLVED 0.15.1]

Posted: Mon Jul 04, 2022 11:31 pm
by Interkarma
First reported on reddit below.

https://www.reddit.com/r/daggerfallunit ... _hit_them/

There's a mechanism to clear guard pursuit when player leaves town and active crime state clears. A transformed werewolf is immune to criminal outcomes when fighting guards, and this is likely triggering the guard clearing behaviour improperly.

Re: 0.13.5 - Possible bad interaction between guard reset on crime state clear and werewolf form

Posted: Sat Dec 17, 2022 1:11 pm
by JorisVanEijden
As stated in viewtopic.php?p=64278#p64278

Comitting a crime while in lycan form clears any current charges And being cleared of charges despawns the guards.

Ignoring crime while in lycan form rather than clearing the current crime would solve this issue right?
That is a very easy code change. Or am I overlooking anything?

Re: 0.13.5 - Possible bad interaction between guard reset on crime state clear and werewolf form

Posted: Sun Dec 18, 2022 8:43 pm
by Interkarma
Ah, the other issue is a duplicate then. I'll close it.

As I said in the other issue, I'm fully aware of what's causing the problem. I just haven't gotten around to fixing this in a way I like yet. Cheers.

Re: 0.13.5 - Possible bad interaction between guard reset on crime state clear and werewolf form

Posted: Tue Dec 20, 2022 6:18 am
by JorisVanEijden
No worries. Feel free to use us as rubber ducks though.

I still feel this code is not quite right:

Code: Select all

void SetCrimeCommitted(Crimes crime)
{
    // Racial override can suppress crimes, e.g. transformed lycanthrope
    RacialOverrideEffect racialOverride = GameManager.Instance.PlayerEffectManager.GetRacialOverrideEffect();
    bool suppressCrime = racialOverride != null && racialOverride.SuppressCrime;

    crimeCommitted = (!suppressCrime) ? crime : Crimes.None;

    RaiseOnCrimeUpdateEvent(crimeCommitted);
}
and it should be:

Code: Select all

void SetCrimeCommitted(Crimes crime)
{
    // Racial override can suppress crimes, e.g. transformed lycanthrope
    RacialOverrideEffect racialOverride = GameManager.Instance.PlayerEffectManager.GetRacialOverrideEffect();
    if (racialOverride != null && racialOverride.SuppressCrime)
        return;
    
    crimeCommitted = crime;

    RaiseOnCrimeUpdateEvent(crimeCommitted);
}
And if any previous crime really is to be reset when in lycan form, why wait until a new crime to do it? Why not immediately?