• 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 Crash Due to ClearCharacter Called on Mutinuous Captain

Not since my last post, I just left the changes I made to ClearCharacter in place and kinda forgot about it. :rolleyes:
 
Alright then. Eventually I'll do some checking myself.
But not guarantees on when. Hopefully within another week or so.
 
I am now thinking it is actually LogoffCharactersFromLocation that does this, rather than one of those other two functions!
The testing continues....
 
This change in PROGRAM\Characters\characters_login.c fixes the problem:
Code:
void LogoffCharactersFromLocation(ref loc)
{
   int i;
   ref chr;
   string locID = loc.id;
   for(i = 0; i < LAi_numloginedcharacters; i++) //Levis: only use logged in characters
   {
     chr = &Characters[LAi_loginedcharacters[i]]; //Levis: only use logged in characters
   //   if (!CheckAttribute(chr, "location"))   continue; // PB: Then we don't need this anymore, do we?
   //   if (chr.location != locID)         continue; // PB: Same here
     if (HasSubStr(chr.id, "Enc_Officer_"))
     {
       if(bAllies(chr))                   { continue; }
       if(LAi_IsBoardingProcess())
       {
         if (chr.id == boarding_enemy.id)         { continue; }   // PB: Skip the captain of the ship you're currently boarding
         if (IsOfficerOf(boarding_enemy, chr))       { continue; }   // MM: Skip also any officers assigned to this ship
       }
     //   TraceAndLog("LogoffCharactersFromLocation clears " + GetMySimpleName(chr));
       ClearCharacter(chr); // PB: Completely erase the unused character
     }
   }
}

I also ran into some silly other things, that I'm fixing now as well:
- Companion decided to defect to Holland. Holland in neutral to Portugal, so I lost my Portuguese LoM for capturing my own ship back!
- Companion managed to find Dutch soldier uniforms somewhere
^ EDIT: Well, that one has been avoided now, except in your particular example because the "HMS_Surprise" is specifically set as "navy only" ship.

Question to @ANSEL: I see that "Joshamee Gibbs" is being cleared.
As far as I can tell, he genuinely is not an officer of yours so it is OK for him to be erased.
But what happened? Did you fire him him??? :shock
 
Last edited:
Lately I have been looking at the Ardent storyline stuff, so sorry I forget all about Gibbs.
Alright then. Well, as far as I can tell, him being cleared isn't actually wrong so I'm going to assume it is indeed fine.
If it turns out it isn't, I'm sure someone will make a report about it sooner or later. :wp
 
Back
Top