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!
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
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 -
Huh? Quick look through the function:And "error.log" contains a lot of this:
bool GetStoreGoodsUsed(ref _refStore,int _Goods)
{
ref ctown = GetTownFromID(GetTownIDFromGroup(_refStore.group));//PW for using island not store attributes
int tradeType = GetGoodTradeType(Islands[FindIsland(ctown.island)], _Goods);//PW for using island not store attributes
string tmpstr = Goods[_Goods].name;
if( !CheckAttribute(_refStore,"Goods."+tmpstr) ) return false;
if( sti(_refStore.Goods.(tmpstr).NotUsed)==true ) return false;
//if (sti(_refStore.Goods.(tmpstr).TradeType) == TRADE_TYPE_CONTRABAND) {
if (tradeType == TRADE_TYPE_CONTRABAND)) {// PW change to function to use island based tradeType
if (!CheckOfficersPerk(GetMainCharacter(),"Trustworthy") && !LAi_IsCapturedLocation && GetTownNation(GetTownIDFromGroup(_refStore.group)) != PERSONAL_NATION) return false; // KK
}
// KNB - Check NoTrade flag for goods.
if( CheckAttribute(Goods[_Goods],"NoTrade") && Goods[_Goods].NoTrade == true) return false;
return true;
}
if( !CheckAttribute(_refStore,"Goods."+tmpstr) ) return false;
if( sti(_refStore.Goods.(tmpstr).NotUsed)==true ) return false;
Slight problem:
View attachment 37370
And "error.log" contains a lot of this:Code:RUNTIME ERROR - file: store\storeutilite.c; line: 288 function must return value RUNTIME ERROR - file: store\storeutilite.c; line: 288 function 'GetStoreGoodsUsed' stack error
Huh? Quick look through the function:
I'd expect that error if there is a 'return' line without 'true/false' in a 'bool' function.
But none of them are missing the value, so at first glance it shouldn't trigger those errors...
That said, if the STORE goods shouldn't be used anymore, does that mean these two lines are superfluous now too?
Code:if( !CheckAttribute(_refStore,"Goods."+tmpstr) ) return false; if( sti(_refStore.Goods.(tmpstr).NotUsed)==true ) return false;
if (tradeType == TRADE_TYPE_CONTRABAND)) {// PW change to function to use island based tradeType
if(tradeType == TRADE_TYPE_CONTRABAND)
{
Fixed. It's the bane of modders, a misplaced bracket on this line:Job done, I would say.Code:if (tradeType == TRADE_TYPE_CONTRABAND)) {// PW change to function to use island based tradeType
Huh; I thought I had seen same-line opening brackets before.It's the bane of modders, a misplaced bracket on this line:Code:if (tradeType == TRADE_TYPE_CONTRABAND)) {// PW change to function to use island based tradeType
The '{' is not the problem. It's the '))'.Huh; I thought I had seen same-line opening brackets before.
Maybe because the { is followed immediately by the // ?
OH! TWO of them. Completely slipped my notice.The '{' is not the problem. It's the '))'.
I definitely agree it reads much nicer that way.The only reason I noticed it was that I don't like '{' at the end of a line
[...]
It makes code easier to read if the opening '{' and closing '}' are on their own lines, equally indented, with the content of the block indented one tab further. Especially when there are nested blocks.