Yes, happens quite often also in 4.1.okay I should look into this one soon(ish) ...
@vojtaniz you said the bug is also in 4.1 right?
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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Yes, happens quite often also in 4.1.okay I should look into this one soon(ish) ...
@vojtaniz you said the bug is also in 4.1 right?
Which part are you referring to? I see nothing really unusual in there....Have anybody being looking at the System log ?
That's what I thought too. See post #14 for where I'd suspect the problem to lie:The stack overflow error happens for example in an endless loop. Something like this seems to be happening here.
void SetCharacterGoods(ref _refCharacter,int _Goods,int _Quantity)
{
// if (IsTrader(_refCharacter)) return; // KK - PB: Quest traders need cargo too
string goodsName = Goods[_Goods].name;
string goodsAttr = "Ship.Cargo.Goods." + goodsName; // PB: Prevent errors
if (sti(GetAttribute(_refCharacter, goodsAttr)) == _Quantity) return; // KK
_refCharacter.Ship.Cargo.Goods.(goodsName) = _Quantity;
int curLoad = RecalculateCargoLoad(_refCharacter);
trace("curload ="+curLoad);
int maxLoad = GetCargoMaxSpace(_refCharacter);
trace("maxload ="+maxLoad);
if(curLoad>maxLoad)
{
// KK -->
//Trace("ERROR! Cargo space overup (character=" + _refCharacter.index + ",Quantity=" + _Quantity + ", curload=" + curLoad + ",maxload=" + maxLoad + ")"); // NK 05-04-06
trace("overload");
ClearCharacterGoods(_refCharacter, _Goods);
SetCharacterGoods(_refCharacter, _Goods, GetGoodQuantityByWeight(_Goods, GetCargoFreeSpace(_refCharacter)));
// <-- KK
}
}
curload =4737
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
curload =4681
maxload =4679
overload
void SetCharacterGoods(ref _refCharacter,int _Goods,int _Quantity)
{
// if (IsTrader(_refCharacter)) return; // KK - PB: Quest traders need cargo too
string goodsName = Goods[_Goods].name;
string goodsAttr = "Ship.Cargo.Goods." + goodsName; // PB: Prevent errors
if (sti(GetAttribute(_refCharacter, goodsAttr)) == _Quantity) return; // KK
_refCharacter.Ship.Cargo.Goods.(goodsName) = _Quantity;
int curLoad = RecalculateCargoLoad(_refCharacter);
trace("curload ="+curLoad);
int maxLoad = GetCargoMaxSpace(_refCharacter);
trace("maxload ="+maxLoad);
if(curLoad>maxLoad && _Quantity>0)
{
// KK -->
//Trace("ERROR! Cargo space overup (character=" + _refCharacter.index + ",Quantity=" + _Quantity + ", curload=" + curLoad + ",maxload=" + maxLoad + ")"); // NK 05-04-06
trace("overload");
ClearCharacterGoods(_refCharacter, _Goods);
SetCharacterGoods(_refCharacter, _Goods, GetGoodQuantityByWeight(_Goods, GetCargoFreeSpace(_refCharacter)));
// <-- KK
}
}
So the ship somehow had MORE cargo than actually fit in the ship BEFORE the crash occurred?For some reason the ship has a bit more cargo.
Beats me too. After applying this fix the goods are set right and the next day I have less cargo because food etc is also deducted. This will prevent the function from going into an endless loop. And personally I'm not feeling up to the task of decyphering the whole daily update code to see what is happening there if this fixes it tooSo the ship somehow had MORE cargo than actually fit in the ship BEFORE the crash occurred?
And that 'overload' failsafe was doing its best, but all it was doing was to set the goods to 0 for one type of good and that wasn't actually enough to solve the overload?
I can see how that might be a problem.
Beats me how it can even happen though!
Fair enough. It may not address the root cause, but does solve the main issue of the game crashing.Beats me too. After applying this fix the goods are set right and the next day I have less cargo because food etc is also deducted. This will prevent the function from going into an endless loop. And personally I'm not feeling up to the task of decyphering the whole daily update code to see what is happening there if this fixes it too