Jump to content

Docks Barracks Soldier Fix


icelus

Recommended Posts

Again, this may be on the fix/UB borderline...

 

In the soldier barracks on the docks, the .are spawned in two of the same characters, and neglected a third.

 

COPY_EXISTING ~ar0332.are~ ~override/ar0332.are~      /* Replaces duplicate DOCSOL02 with DOCSOL03 in Docks Barracks */

WRITE_ASCII 0x3bc ~DOCSOL03~

Link to comment

Coded in alpha 1; added additional patching safeguards as follows:

 

COPY_EXISTING ~ar0332.are~ ~override/ar0332.are~
 READ_LONG 0x54 "act_off"
 READ_LONG 0x58 "act_num"
 SET "nodupe" = 0
 WHILE ("%act_num%" > 0) BEGIN
   SET "act_num" = ("%act_num%" - 1)
   READ_ASCII (("%act_off%" + 0x80 + (0x110 * "%act_num%")) "cre_res"
   PATCH_IF (("%cre_res%" STRING_COMPARE_CASE "DOCSOL02" = 0) AND ("%nodupe%" = 1)) BEGIN
     WRITE_ASCII (("%act_off%" + 0x80 + (0x110 * "%act_num%")) ~DOCSOL03~
   END
   PATCH_IF (("%cre_res%" STRING_COMPARE_CASE "DOCSOL02" = 0) AND ("%nodupe%" = 0)) BEGIN
     SET "nodupe" = 1 // this ensures the first occurrence of docsol02 is untouched and the second patched
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...