Jump to content

Sexlab Defeat creatures assaulting male npcs


Recommended Posts

Posted

I'm using the banemaster's edition of defeat and find that male npcs keep on getting assaulted by creatures and female npcs despite having that category disabled in the mod menu. I tried reinstalling the mod and disabling creature on female as well but nothing prevents this.  

Posted (edited)

It's a logic error in defeatconfig.pex. In the SexCombination function, it has this:

...
If !SexLabConfig.UseCreatureGender
    Return True
Else
...

 

Meaning, if SexLab's configuration is set to not UseCreatureGender, then Defeat will not check the gender of the victim despite what you've set its configuration to.

 

Change it to this to fix the issue:

...
If !SexLabConfig.UseCreatureGender
    ;Return True
    
    If (McmConfig.CreaOnFemale && VictimFemale)
        Return true
    ElseIf (McmConfig.CreaOnMale && !VictimFemale)
        Return true
    EndIf
Else
...

 

Edit: Turns out this is not enough. Need to look into it again.

Edited by traison
Posted (edited)

DefeatNVNOnHitScr is also full of places where config settings aren't checked. This thing is all spaghetti though so sorting this out is going to take a while.

 

Edit: Add a new function:

Bool Function IsVictimValid()
    If (McmConfig.CreaOnFemale && IsFemale)
        Return true
    ElseIf (McmConfig.CreaOnMale && !IsFemale)
        Return true
    EndIf
    
    Return false
EndFunction

 

Then call it in the OnHit and OnEnterBleedOut events:

If Victim && !Victim.HasMagicEffect(RessConfig.MiscMagicEffects[0]) && (RessConfig.NVNKDtype <= 2) && IsVictimValid()
...
If Victim && !Victim.HasMagicEffect(RessConfig.MiscMagicEffects[0]) && IsVictimValid()

 

Not tested.

Edited by traison

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...