Skip to content

Commit

Permalink
now resolving hardcoded formIDs from game esm AND hardcoded dat
Browse files Browse the repository at this point in the history
  • Loading branch information
matortheeternal committed Jul 24, 2018
1 parent 3fa0866 commit 8c98b83
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/xedit/wbImplementation.pas
Expand Up @@ -2836,14 +2836,16 @@ function TwbFile.GetMasterRecordByFormID(aFormID: Cardinal; aAllowInjected: Bool
Result := nil;
FileID := aFormID shr 24;

if (aFormID < $800) and not (fsIsHardcoded in flStates) then begin
if FileID < Cardinal(GetMasterCount) then begin
Master := flMasters[FileID];
Result := Master.RecordByFormID[(aFormID and $00FFFFFF) or (Cardinal(Master.MasterCount) shl 24), aAllowInjected];
end;

if not Assigned(Result) and (aFormID < $800)
and not (fsIsHardcoded in flStates) then begin
Master := GetHardcodedFile;
if Assigned(Master) then
Result := Master.RecordByFormID[aFormID, aAllowInjected];
end
else if FileID < Cardinal(GetMasterCount) then begin
Master := flMasters[FileID];
Result := Master.RecordByFormID[(aFormID and $00FFFFFF) or (Cardinal(Master.MasterCount) shl 24), aAllowInjected];
end;
end;

Expand Down

0 comments on commit 8c98b83

Please sign in to comment.