Skip to content

Commit bb9d193

Browse files
InfernioSharlikran
authored andcommitted
Convert to long FormIDs before patching Stats
This _properly_ fixes the crashes and the ITMs caused by the 'Critical Effect' field of the CRDT subrecord of the WEAP record. The cause was that the record definitions define criticalEffect to be a FID, but to properly initialize FormIDs, convertToLongFids() must first be called. Otherwise, they remain as integers. Later on in the patch building process, we make a copy of each record from the source mods, to be included in the final BP, but this copy procedure (MreRecord.getTypeCopy, if you're curious) converts FormIDs when copying. This resulted in us having cached mod data where criticalEffect was an int, and a copy of that data where criticalEffect was a FormID. Long FormIDs are tuples of a string and an integer, while short FormIDs are just integers. Obviously, a comparison between the two will show them as different - causing the BP to think that _every_ record that occurs in a source mod had changes that needed to be preserved - hence the ITMs. I haven't figured out how this was responsible for the crashes, but I can confirm that they're fixed as of this commit. Supersedes 'Fix Duplicate Records In Stats Parsing' (73be14f).
1 parent 44ea5ff commit bb9d193

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Mopy/bash/game/skyrim/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17071,7 +17071,7 @@
1707117071
'SLGM':('eid', 'weight', 'value'),
1707217072
'WEAP':('eid', 'weight', 'value', 'damage', 'speed', 'reach',
1707317073
'enchantPoints', 'stagger', 'critDamage','criticalMultiplier',
17074-
),
17074+
'criticalEffect',),
1707517075
}
1707617076
statsHeaders = (
1707717077
#--Alch

Mopy/bash/parsers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,8 @@ def __init__(self,types=None,aliases=None):
13971397
'stagger':self.sfloat,
13981398
'enchantPoints':self.sint,
13991399
'critDamage':self.sint,
1400-
'criticalMultiplier':self.sfloat,}
1400+
'criticalMultiplier':self.sfloat,
1401+
'criticalEffect':self.sint,}
14011402
elif bush.game.fsName in (u'FalloutNV', u'Fallout3'):
14021403
self.attr_type = {'eid':self.sstr,
14031404
'weight':self.sfloat,

0 commit comments

Comments
 (0)