Skip to content

Commit

Permalink
Fix description of Wayrest Painting non-magic look
Browse files Browse the repository at this point in the history
PAINT.DAT's #70 paintRecord alternatives list for %pp2 is empty, raising
an exception.

Runtime patching of a list, compatible with painting look and "fog over
Cryngaine Field" event.
  • Loading branch information
Pierre Etchemaite committed Jul 16, 2023
1 parent 1ad4507 commit ce9d09e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Assets/Scripts/Game/Items/DaggerfallUnityItemMCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public TextFile.Token[] InitPaintingInfo(int paintingTextId = 250)
dataSource.paintingFilename = paintingFileChar + "PAINT.CIF";

byte[] paintingRecord = DaggerfallUnity.Instance.ContentReader.PaintFileReader.Read(paintingIndex);
if (paintingIndex == 70 && // Known buggy paintingRecord
paintingRecord[30] == 0xFF) // not fixed in PAINT.DAT
{
// That paintingRecord is used for Wayrest Painting, whose non-magic look resembles the fog on Cryngaine Field.
paintingRecord[30] = 3; // summer
paintingRecord[31] = 8; // afternoon
paintingRecord[32] = 10; // Highrock
}
Debug.LogFormat("painting file: {0}, index: {1}, cif idx: {2}, record: {3} {4} {5}", dataSource.paintingFilename, paintingIndex, dataSource.paintingFileIdx, paintingRecord[0], paintingRecord[1], paintingRecord[2]);

dataSource.paintingSub = GetPaintingRecordPart(paintingRecord, 0, 9) + 6100; // for %sub macro
Expand Down

0 comments on commit ce9d09e

Please sign in to comment.