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

Locked
User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

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

Post 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.

User avatar
JorisVanEijden
Posts: 114
Joined: Mon Aug 12, 2019 5:02 pm

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

Post 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?

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

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

Post 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.

User avatar
JorisVanEijden
Posts: 114
Joined: Mon Aug 12, 2019 5:02 pm

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

Post 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?

Locked