• 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 Levelling: Missing Ships and Crashes on Encounter Reload from Worldmap to Sea

Now those crashes are back again. Just happens twice times for me engaging enemy ships.
Sometimes there are no enemy ships, when you reload from worldmap.
 

Attachments

  • error.zip
    385 bytes · Views: 182
  • compile.zip
    17.1 KB · Views: 166
  • system.zip
    2.3 KB · Views: 176
  • error 2.zip
    241 bytes · Views: 158
  • compile 2.zip
    3.2 KB · Views: 167
  • system 2.zip
    1.2 KB · Views: 182
Ruddy bloody evil game!

If you have a save on the worldmap just prior to an encounter that crashes, that should give me something to test from.
 
Never mind, @ANSEL. Niels posted one I can use:
Update: Saw a French fleet on the worldmap sailed to it saved my game, attacked it it said that is was a "Group of merchant flying the French flag, should we engage?" clicked "Yes" immediately a crash uploading the save and crash files.
The fleet is near Jamaica on the world map I sailed behind them.
Thanks a lot! Hadn't noticed you edited your post, but indeed that is Confirmed from my side too. UGH! :modding
 
If you have a save on the worldmap just prior to an encounter that crashes
I will post two savegames prior to the crashes. The 5 June save is the one whit no ships reloading from
worldmap, and it have some of those crashes too.
 

Attachments

  • -=Player=- Open Sea June 14th, 1751.zip
    988.3 KB · Views: 183
  • -=Player=- Open Sea June 5th, 1751.zip
    982.1 KB · Views: 182
I'm not done tracing this problem yet, but I do believe I'm getting further with the investigation.
The CTD just happens because there are no ships being generated. I already figured out how to bypass that last time.
Now I discovered that the ships aren't being loaded to sea, because the game considers their captains ALREADY DEAD!

This here captain got generated with an HP of 0:
Code:
chr_ai =
  hp = 0.0000000
  hp_max = 65.0000000
  type = stay
  tmpl = stay
  login = 0
  group = corpses
So then the game doesn't bother adding the ship. :facepalm

Next question is: WHY does this happen? Did you kill this character before and the HP doesn't get reset now?

The search continues.... but not today....
 
Here's the guy's full attribute dump:
Code:
SEA: Ship_Add2Sea adding character fenc_2000 to sea
SEA: Ship_Add2Sea character is DEAD!
id = fenc_2000
index = 2000
name = Desire
old =
  name = Maugis
  lastname = Terhune
  chr_ai =
  hp = 40.0000000
  hp_max = 40.0000000
  type = stay
  dialog =
  currentnode = First time
  tempnode = First time
  items =
  blade2+1 = 1
  blade = blade2+1
lastname = Saint-Chéron
sex = man
model = man6_1
  entity = NPCharacter
  animation = man
  height = 1.8000000
location = none
  group =
  locator =
  from_sea =
  stime = 6.0000000
  etime = 21.9833298
ship =
  type = FastMerchantman1
  idx = 53
  mode = trade
  cannons =
  charge =
  type = 2
  type = 2
  speedv0 = 125.0735703
  fireangmax = 1.0000000
  fireangmin = 1.0000000
  borts =
  cannonf =
  qty = 0
  cannonb =
  qty = 0
  cannonl =
  qty = 5
  cannonr =
  qty = 5
  tune =
  cplates =
  on = 0
  bcannons =
  on = 0
  gchasers =
  on = 0
  nsails =
  on = 1
  speedrate = 0.1197339
  sails = 0.0424534
  ltopmasts =
  on = 0
  speedrate = 0.0097647
  sailcrit = 4
  stays =
  on = 0
  rhull =
  on = 0
  hp = 568.9332275
  incaliber = 1
  flushed =
  on = 0
  tack = 0
  tackmod = 0
  maxcaliber = 32
  name = Libre
  crew =
  quantity = 168
  morale = 37
  minratio = 1.0000000
  hp = 1377
  sp = 200
  pos =
  x = 1775.38
  z = -2435.51
  mode = 0
  y = 1.22236
  ang =
  y = 0.946212
  x = 0.0536488
  z = -0.0112466
  cargo =
  load = 1291
  goods =
  ration = 0
  rum = 0
  balls = 55
  grapes = 0
  knippels = 60
  bombs = 0
  gunpowder = 1365
  sailcloth = 14
  planks = 20
  gold = 0
  silver = 0
  cinnamon = 0
  chocolate = 180
  coffee = 0
  wheat = 0
  medicines = 0
  paprika = 354
  wine = 0
  sandal = 0
  ebony = 0
  mahogany = 0
  sugar = 0
  tobacco = 0
  ale = 0
  silk = 0
  linen = 0
  fruits = 0
  clothes = 0
  bricks = 0
  oil = 0
  cotton = 0
  copra = 0
  leather = 0
  recalculatecargoload = 0
  impulse =
  rotate =
  x = 0.0000000
  y = 0.0000000
  z = 0.0000000
  speed =
  x = 0.0000000
  y = 0.0000000
  z = 0.0000000
  lastballcharacter = -1
  speed =
  z = 11.0813
  y = -0.00822715
  x = 0
  strand = 0
  sndid = 0
  stopped = 0
  maxspeedz = 15.0681667
  maxspeedy = 0.0549420
  correctimmersion = 0.3994061
  immersion = 0.3994061
  boxsize =
  x = 9.54322
  y = 27.9055
  z = 24.6521
  old =
  masts =
  mast1 = 0
  mast2 = 0
  mast3 = 0
  plunder =
  plunder0 = 24
  plunder1 = 6
  plunder2 = 55
  plunder4 = 60
  plunder6 = 1365
  plunder7 = 14
  plunder8 = 20
  plunder12 = 180
  plunder16 = 354
  stats =
  nation = 1
  weight = 11680
  capacity = 2337
  maxcrew = 177
  mincrew = 31
  speedrate = 14.8000698
  turnrate = 44.4599113
  price = 91960
  hp = 2571
  origspeed = 14.6803360
  sails =
  gerald = 0
dialog =
  currentnode = First time
  tempnode = First time
quest = True
  meeting = 0
  officertype = merchant captain
  officerprice = 4456
nation = 1
  name = 1
  known = -2
skill =
  freeskill = 0
  sneak =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  sailing =
  modifier = 0
  party = 1
  shipclass = 5
  fleetsize = 1
  ship = 1
  leadership = 1
  modifier = 0
  party = 1
  shipclass = 5
  fleetsize = 1
  ship = 1
  commerce =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  defence =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  grappling =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  repair =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  fencing =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  accuracy =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
  cannons =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 6
  fleetsize = 1
rank = 1
reputation = 45
headmodel = h_man6_1
chr_ai =
  hp = 0.0000000
  hp_max = 65.0000000
  type = stay
  tmpl = stay
  login = 0
  group = corpses
abordagemode = 1
issoldier = 0
seaai =
  group =
  name = egroup__2
  task = 6
  target =
  pos =
  x = 8855.1904297
  z = 4646.0307617
shiptype = FastMerchantman1
fantomtype = trade
points = 2.3360000
faceid = 30
items =
  blade2+1 = 1
  blade2-1 = 1
  merchantsblade = 2
  pistol1-2 = 1
  gunpowder = 3
  pistolbullets = 4
equip =
  blade = MerchantsBlade
  gun = pistol1-2
shipmoney = 6
features =
  geraldsails = 0
tmpperks =
  turn = 0
  basicdefence = 0
  advanceddefence = 0
  toughness = 0
  criticalhit = 0
  swordplayprofessional = 0
  rush = 0
  gunman = 0
  improveaiming = 0
  gunprofessional = 0
  gunfighter = 0
  improvepotions = 0
  defendpoison = 0
  shipturnrateup = 0
  shipspeedup = 0
  turn180 = 0
  sandbankmaneuver = 0
  stormprofessional = 0
  sailingprofessional = 0
  basicbattlestate = 0
  advancedbattlestate = 0
  shipdefenceprofessional = 0
  fastreload = 0
  immediatereload = 0
  hulldamageup = 0
  sailsdamageup = 0
  crewdamageup = 0
  criticalshoot = 0
  longrangeshoot = 0
  cannonprofessional = 0
  longrangegrappling = 0
  musketsshoot = 0
  grapplingprofessional = 0
  instantboarding = 0
  troopers = 0
  lightrepair = 0
  instantrepair = 0
  cooking = 0
  highstakes = 0
  improvesmuggling = 0
  advancesmuggling = 0
  basiccommerce = 0
  advancedcommerce = 0
  trustworthy = 0
  basiclandowner = 0
  sharedexperience = 0
  ironwill = 0
  brander = 0
contriblist =
  basicdefence = 0
  advanceddefence = 0
  toughness = 0
  criticalhit = 0
  swordplayprofessional = 0
  rush = 0
  gunman = 0
  improveaiming = 0
  gunprofessional = 0
  gunfighter = 0
  improvepotions = 0
  defendpoison = 0
  shipturnrateup = 0
  shipspeedup = 0
  turn180 = 0
  sandbankmaneuver = 0
  stormprofessional = 0
  sailingprofessional = 0
  basicbattlestate = 0
  advancedbattlestate = 0
  shipdefenceprofessional = 0
  fastreload = 0
  immediatereload = 0
  hulldamageup = 0
  sailsdamageup = 0
  crewdamageup = 0
  criticalshoot = 0
  longrangeshoot = 0
  cannonprofessional = 0
  longrangegrappling = 0
  musketsshoot = 0
  grapplingprofessional = 0
  instantboarding = 0
  troopers = 0
  lightrepair = 0
  instantrepair = 0
  cooking = 0
  highstakes = 0
  improvesmuggling = 0
  advancesmuggling = 0
  basiccommerce = 0
  advancedcommerce = 0
  trustworthy = 0
  basiclandowner = 0
  sharedexperience = 0
  ironwill = 0
  brander = 0
lastsailstate = 2
tmpskill =
  commerce = 0.1000000
  leadership = 0.1000000
  sneak = 0.1000000
  defence = 0.1000000
  grappling = 0.1000000
  sailing = 0.1000000
  repair = 0.1000000
  fencing = 0.1000000
  accuracy = 0.1000000
  cannons = 0.1000000
perks =
  list =
flags =
seatime =
  basecrewmorale = 37
  basecrewquantity = 95
  timesincelast = 0
  tempmorale = 37.0000000
  lasthit = 125
status = dead
position = captive
fight = 0
fakelevels = 0
deathx = 0.0000000
deathy = 100.0000000
deathz = 1771.8800049
deathay = -2446.3200684
storedattributes = 1
actions =
  idle =
  i1 = idle_1
  i2 = idle_2
  i3 = idle_3
  i4 = idle_4
  i5 = idle_5
  i6 = idle_6
  i7 = idle_7
  i8 = idle_8
  i9 = idle_9
  i10 = idle_10
  walk = walk
  backwalk = back walk
  run = run
  backrun = back run
  stsup = stairs up
  stsuprun = run stairs up
  stsdown = stairs down
  stsdownrun = run stairs down
  stsupback = back stairs up
  stsdownback = back stairs down
  stsuprunback = back run stairs up
  stsdownrunback = back run stairs down
  turnleft = turn left
  turnright = turn right
  swim = swim
  hit = face_hit
  h1 = hit_1
  h2 = hit_2
  h3 = hit_3
  sidestep_left_on = skip
  sidestep_right_on = skip
  fightwalk = fight walk
  fightbackwalk = fight back walk
  fightrun = fight run
  fightbackrun = fight back run
  attack =
  a1 = attack_1
  a2 = attack_2
  a3 = attack_3
  a4 = attack_4
  a5 = attack_5
  a6 = attack_6
  a7 = attack_7
  a8 = attack_8
  attacktl =
  a1 = attack_left_1
  attacktr =
  a1 = attack_right_1
  block = block
  blockhit = block_hit
  recoil = Recoil
  shot = Shot
  fightsidestep_left_on = skip
  fightsidestep_right_on = skip
  fightdead =
  d1 = death_0
  d2 = death_1
  d3 = death_2
  d4 = death_3
  fightidle =
  i1 = fight stand_1
  i2 = fight stand_2
  i3 = fight stand_3
  i4 = fight stand_4
  dead =
  d1 = death_citizen_1
  d2 = death_citizen_2
money = 0
killer =
  index = 0
  status = 2
isfantom = 1
needsaildmg = 7.0000000
Done adding character
 
Dead sea captains - spooky - and only four nights to fix it before Halloween!!

The creation you quote says hp =0 and hp max =65 but the attributes dump says 40.0 and 40.0 and ship details so where does (or doesn't) the change come in? (rhetorical question)

EDIT although the "dead" attribute does suggest this is an earlier unre-initialised entity?
 
Last edited:
I had three captains. I may accidentally have pasted the first lines from Captain and the whole entry for another....

The problem most likely comes from these characters being reused but not properly reset.
 
I had three captains. I may accidentally have pasted the first lines from Captain and the whole entry for another....

No its my mistake the hp/hp max 40.0 are under old= the "new" hp=0 and max 65 are further down the attribute list

The problem most likely comes from these characters being reused but not properly reset.

In the case you quote the cr index is 2000 ie the first permanent fantom number - so is it a case that the array slowly fills up with corpse captains etc which is why the crashes only come later in playing, when you've run to the end of available slots at 2250. Perhaps all you need is a check to see if they are in corpse group and if so reset them as they are about to be re-used.

Don't bother with a reply, you've enough to do without feeding my ramblings, I'll just wait and see when you've found and fixed the cause.
 
In the case you quote the cr index is 2000 ie the first permanent fantom number - so is it a case that the array slowly fills up with corpse captains etc which is why the crashes only come later in playing, when you've run to the end of available slots at 2250. Perhaps all you need is a check to see if they are in corpse group and if so reset them as they are about to be re-used.
That is indeed pretty much what must be happening. Though they aren't part of the "corpse" group; it seems it is just that HP thing.

Probably when the character ID is reused, the character isn't fully reset. I may add a call to my ClearCharacter function that erases ALL the character attributes.
@Levis and I were considering to add that in more spots where characters in the array are being repurposes to prevent left-over attributes from earlier uses.
May be tricky to get right, but would probably make for the cleanest solution in the end.
 
Well, I seem to have got it all working again with the following "fix":
Code:
// return new added fantom character
void Fantom_AddFantomCharacter(string sGroupName, int iShipType, string sFantomType, int iEncounterType, int iNation) // NK 04-09-05 add nation argument
{
   ref rFantom = GetFantomCharacter(iNumFantoms);
   ClearCharacter(rFantom); // PB: Clear ALL attributes from previous character
   rFantom.nation = iNation; // NK

   DeleteAttribute(rFantom, "relation");

   rFantom.SeaAI.Group.Name = sGroupName;
   rFantom.Ship.Type = GetShipID(iShipType); // PS
   //trace("added fantom " + rFantom.index + " with ship " + rFantom.ship.type);
   rFantom.Ship.idx = iShipType; // PS
   rFantom.Ship.Mode = sFantomType;
   rFantom.ship.cannons.Charge.Type = GOOD_BALLS;
//NK -->
   DeleteAttribute(rFantom,"ship.cannons.borts"); rFantom.ship.cannons.borts = ""; // NK 05-04-18 cannon qty
   // PRS3 -->
   aref arship; makearef(arship, rFantom.ship);
   DeleteAttribute(rFantom, "ship.stats");
//KB - Tuning ships - changed call to SetRandomStatsToShip
   SetRandomStatsToShip(sti(rFantom.index), iShipType, iNation);
//KB - orig  SetRandomStatsToShip(arship, iShipType, iNation);
//KB
// PRS3 <--
   if(sti(rFantom.nation) == PIRATE) { sFantomType = "pirate"; }
   else { if(sFantomType == "pirate") { sFantomType = "war"; } }
   rFantom.shiptype = GetShipID(iShipType); // PS
   rFantom.FantomType = sFantomType;
   float mult = 1.0;
   if(DEBUG_EXPERIENCE>0) TraceAndLog("Fantom_AddFantomCharacter: Set officer type for " + GetMySimpleName(rFantom));
   switch(sFantomType)
   {
     case "trade":
       mult *= 1.0;
       rFantom.quest.officertype = OFFIC_TYPE_CAPMERCHANT;
       break;
      
     case "war":
       mult *= 1.25;
       rFantom.quest.officertype = OFFIC_TYPE_CAPNAVY;
       break;
      
     case "pirate":
       mult *= 1.25;
       rFantom.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;

     case "error":
       mult *= 1.0;
       rFantom.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;
   }
   ref Shiptype = GetShipByType(iShipType);
   int iMCShipClass = makeint(GetCharacterShipClass(GetMainCharacter()));
   if (sti(Shiptype.Class) < iMCShipClass) {
     mult *= 1.15;
   } else {
     if (makeint(Shiptype.Class) > iMCShipClass) mult *= 0.85;
   }
   rFantom.Points = mult * stf(GetLocalShipAttrib(&arship,&Shiptype,"Weight")) / 5000; // PRS3
   //Log_SetStringToLog("Type: " + rFantom.FantomType + "; Mult: " + rFantom.Points);
// NK <--
   CheckCharacterSetup  (rFantom); // PB: Sets minimum character attributes
   PrepareSelectPerksForCharacter(rFantom); // PB: Prepare perks list to avoid errors on the next step
   FinishCharInit  (rFantom); // PB: Includes resetting character HP
   iNumFantoms++;
}
Basically I'm removing ALL character attributes before the new character is created,
then executing a whole bunch of @Levis' new functions until the game would stop giving error logs.

This does seem to get the job done, but.... uhm.... I don't think it is a pretty solution.
Probably overkill and I'd really, really want Levis to have a proper look at this instead of me trying to reverse-engineer what is supposed to be going on! :modding

EDIT: This now included in here so you guys can at least continue playing again:
Mod Release - Build 14 Beta 4 Internal WIP For Testing | PiratesAhoy!
 
Apparently that was NOT actually good enough. While initially everything seemed OK, it resulted in plenty error.log entries about missing skills.
I've now replaced those several lines at the end with one function call instead:
Code:
InitCharacterSkills(rFantom);
As far as I can tell, this one does work without errors. But it still has to be tested AND confirmed by @Levis. :whipa

Updated now here: Mod Release - Build 14 Beta 4 Internal WIP For Testing | PiratesAhoy!
 
I will take a look at it later but looks to me like it's working more or less ;) .
 
I will take a look at it later but looks to me like it's working more or less ;) .
This is the final "fix" I came up with:
Code:
void Fantom_AddFantomCharacter(string sGroupName, int iShipType, string sFantomType, int iEncounterType, int iNation) // NK 04-09-05 add nation argument
{
   ref rFantom = GetFantomCharacter(iNumFantoms);
   ClearCharacter(rFantom); // PB: Clear ALL attributes from previous character
   rFantom.nation = iNation; // NK

//   DeleteAttribute(rFantom, "relation"); // PB: Character already cleared

   rFantom.SeaAI.Group.Name = sGroupName;
   rFantom.Ship.Type = GetShipID(iShipType); // PS
   //trace("added fantom " + rFantom.index + " with ship " + rFantom.ship.type);
   rFantom.Ship.idx = iShipType; // PS
   rFantom.Ship.Mode = sFantomType;
   rFantom.ship.cannons.Charge.Type = GOOD_BALLS;
//NK -->
//   DeleteAttribute(rFantom,"ship.cannons.borts"); rFantom.ship.cannons.borts = ""; // NK 05-04-18 cannon qty // PB: Character already cleared
   // PRS3 -->
   aref arship; makearef(arship, rFantom.ship);
//   DeleteAttribute(rFantom, "ship.stats"); // PB: Character already cleared
//KB - Tuning ships - changed call to SetRandomStatsToShip
   SetRandomStatsToShip(sti(rFantom.index), iShipType, iNation);
//KB - orig  SetRandomStatsToShip(arship, iShipType, iNation);
//KB
// PRS3 <--
   if(sti(rFantom.nation) == PIRATE) { sFantomType = "pirate"; }
   else { if(sFantomType == "pirate") { sFantomType = "war"; } }
   rFantom.shiptype = GetShipID(iShipType); // PS
   rFantom.FantomType = sFantomType;
   float mult = 1.0;
   if(DEBUG_EXPERIENCE>0) TraceAndLog("Fantom_AddFantomCharacter: Set officer type for " + GetMySimpleName(rFantom));
   switch(sFantomType)
   {
     case "trade":
       mult *= 1.0;
       rFantom.quest.officertype = OFFIC_TYPE_CAPMERCHANT;
       break;
       
     case "war":
       mult *= 1.25;
       rFantom.quest.officertype = OFFIC_TYPE_CAPNAVY;
       break;
       
     case "pirate":
       mult *= 1.25;
       rFantom.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;

     case "error":
       mult *= 1.0;
       rFantom.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;
   }
   ref Shiptype = GetShipByType(iShipType);
   int iMCShipClass = makeint(GetCharacterShipClass(GetMainCharacter()));
   if (sti(Shiptype.Class) < iMCShipClass) {
     mult *= 1.15;
   } else {
     if (makeint(Shiptype.Class) > iMCShipClass) mult *= 0.85;
   }
   rFantom.Points = mult * stf(GetLocalShipAttrib(&arship,&Shiptype,"Weight")) / 5000; // PRS3
   //Log_SetStringToLog("Type: " + rFantom.FantomType + "; Mult: " + rFantom.Points);
// NK <--
   InitCharacterSkills(rFantom);   // PB: Reset this character
   iNumFantoms++;
}
Quick tests suggest that this does help, but I don't know if what I did is actually the right way to handle this.
If it is, the same may need to be done in other spots where character slots are being reused.

I also wasn't sure in my tests if this actually solves ALL instances of the problem.
In today's update, I have added an extra notification if any "dead" captains still occur despite this "fix".
 
This should work from what I can see.
Why doesn't this call CreateFantomCharacterEx though?
that function should have everything in place also ...
 
Why doesn't this call CreateFantomCharacterEx though?
that function should have everything in place also ...
Haven't a clue. Looks like "CreateFantomCharacter" is generally only called ashore.
No references to it anywhere in the SEA_AI folder.

I also noticed that this function from Ships.c is used exclusively in one spot of the Standard Storyline and nowhere else:
Code:
// PB: Why is this function not used outside the Standard Storyline quests_reaction.c file???
void SetUpShip(ref chr, string ftype, bool isgen)
{
   if(!CheckAttribute(chr,"ship.type")) return;
   if(chr.ship.type == SHIP_NOTUSED_TYPE_NAME) return;
   int iShipType = GetCharacterShipType(chr);
   if(iShipType == -1) return;
   if(iShipType == SHIP_NOTUSED) return;
   SetBaseShipData(&chr);
   ref Shiptype = GetShipByType(iShipType);
   // PRS3 -->
   aref arship; makearef(arship, chr.ship);
   // PRS3 <--
   if(sti(chr.nation) == PIRATE) ftype= "pirate";
   chr.FantomType = ftype;
   float mult = 1.0;
   if(isgen && DEBUG_EXPERIENCE>0) TraceAndLog("SetUpShip: Set officer type for " + GetMySimpleName(chr));
   switch(ftype)
   {
     case "trade":
       mult *= 1.0;
       if(isgen) chr.quest.officertype = OFFIC_TYPE_CAPMERCHANT;
       break;

     case "war":
       mult *= 1.25;
       if(isgen) chr.quest.officertype = OFFIC_TYPE_CAPNAVY;
       break;

     case "pirate":
       mult *= 1.0;
       if(isgen) chr.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;

     case "error":
       mult *= 1.0;
       if(isgen) chr.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;
   }
   int iMCShipClass = makeint(GetCharacterShipClass(GetMainCharacter()));
   //Log_SetStringToLog("Mult 1 = " + mult);
   if(makeint(Shiptype.Class) < iMCShipClass) mult *= 1.5;
   if(makeint(Shiptype.Class) > iMCShipClass) mult *= 0.75;
   chr.Points = mult * stf(GetLocalShipAttrib(arship, Shiptype, "Weight")) / 5000; // PRS3
   //Log_SetStringToLog("NewM " + mult);
   //end hack.

   //set various stuff using AIFantom calls.
   if(isgen) LAi_Create_Officer(0, chr);
   if(isgen) Fantom_SetRandomMoney(chr, ftype);
   Fantom_SetCannons(chr, ftype);
   Fantom_SetSails(chr, ftype);
   if(isgen) Ship_SetFantomData(chr);
   Fantom_ClearCargo(chr); // TIH clear out prior slot cargo
   Fantom_SetBalls(chr, ftype);
   Fantom_SetGoods(chr, ftype);
}
// PS <--
Doesn't make so much sense either. :facepalm
 
yeah noticed that too. But I was afraid to change it because we probably break stuff...
 
Back
Top