Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.67k stars 326 forks source link

Fixed error during GetCourtOfCurrentRegion query in Mournoth #2673

Open KABoissonneault opened 1 month ago

KABoissonneault commented 1 month ago

In FACTION.TXT, you can find 44 factions of the "Court" guild type. Out of these, 43 have the social group Nobility - we have only one exception, the Court of Mournoth.

    #567
    type: 14
    name: Court of Mournoth
    rep: 0
    summon: -1
    region: 53
    power: 51
    face: -1
    race: 2
    flat: 183 3
    flat: 183 9
>>> sgroup: 2
    ggroup: 15
    flags: 0
    minf: 20
    maxf: 80

As documented at the top of FACTION.TXT,

; The field sgroup should be set to one of the following values:
; COMMONER  0
; MERCHANT  1
; SCHOLAR   2
; NOBILITY  3
; UNDERWORLD    4

sgroup of 2 is Scholar.

In DFU's search for the current region's Court, it specified that the faction it's looking has to be Nobility. This is an unnecessary restriction, and causes the Scholarly Court of Mournoth to fail to return here, causing an exception to be thrown.

This PR simply allows all social groups to be considered a court, as long as it's of the regional guild group and the court faction type

KABoissonneault commented 1 month ago

Fixes issue #2672

df-ferital commented 3 weeks ago

Hi @KABoissonneault, hope you're well. I've been away from DF Unity for a while, hopefully I'll be able to contribute again soon.

I wanted to add that while your patch is fine, I would have also fixed FACTION.TXT, as the court factions are indeed supposed to belong to the Nobility social group. This will have an impact in the game when talking to members of this faction, such as the NPCs in town palaces.

KABoissonneault commented 3 weeks ago

Good point. I had assumed without looking that this file was part of DF data, but no, we do ship our own, which we have patched in the past. Gonna keep the current fix for mods, and fix FACTION.TXT as you suggest