• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Captured officer reputation drops when you gain reputation

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
I've captured a pirate. Initially she is "Damsel". Hoping to improve her reputation, I have her as an active officer when I go to claim a promotion - this will get me a +5 reputation boost, and officers get a portion of your reputation changes.

After the promotion, she's "Femme Fatale".

Savegame, in which I'm outside Port Royale townhall about to go inside and claim the promotion, attached.
 

Attachments

  • -=Player=- Jamaica. Port Royale. Center. August 7th, 1664.zip
    1.1 MB · Views: 118
The problem is that character does not have a reputation AT ALL.
And that seems to result in positively bizarre "black computer magic".
 
In PROGRAM\Characters\CharacterUtilite.c find:
Code:
         chOfficer.reputation = iclamp(REPUTATION_MIN, REPUTATION_MAX, GetCharacterReputation(chOfficer) + incrOfficer);
Replace with:
Code:
         int value = GetCharacterReputation(chOfficer) + incrOfficer;       // PB: This MUST use a separate variable or it will not work correctly
         chOfficer.reputation = iclamp(REPUTATION_MIN, REPUTATION_MAX, value );   // PB: But I have no clue why, so this is really quite bizarre
That does fix it. Doesn't stop it from being REALLY VERY WEIRD though!!! :shock
 
To illustrate how crazy this is:
Code:
   ch = CharacterFromID("Enc_Officer_19");
   TraceAndLog("Reputation 1 = " + GetCharacterReputation(ch) ); // returns: Reputation 1 = 45
   ch.reputation = GetCharacterReputation(ch);
   TraceAndLog("Reputation 2 = " + ch.reputation );  // returns: Reputation 2 = 0
Basically the above code reads the character's reputation, then sets it back again.
So it should do absolutely nothing, but it causes a massive change anyway. o_O
 
Back
Top