This is me in Pointe a Pitre on Guadeloupe, about to talk to one of the street traders and then buying items from him:

Nothing unusual about that - except that my ship is currently at Anse Casse-Bois. Until now, if you moor at a beach and then walk into town, neither the store nor street traders have items for sale, and the street traders don't have any money which means you can't sell items either.
After some serious digging involving adding loads of 'trace' commands into both "items_utilite.c" and "Towntable.c", I think I've finally fixed it. This part of function "TownUpdate" seems to be the problem:
First, 'if (TownID == "")' will always fail because if you're at a beach, TownID isn't "", it's "-1". So, change the condition to 'if (TownID == "" || TownID == "-1")'
Second, 'GetAttribute(FindIsland(island),"towns.1")' isn't going to work because 'FindIsland' returns an integer (the island's index). That should probably be 'GetAttribute(GetIslandByID(island),"towns.1")'.
Testing so far looks good - I've landed at beaches on Guadeloupe, Puerto Rico and Barbados, walked into town and been able to trade with street vendors. If you want to test this, download this version of "PROGRAM\Towns\Towntable.c".


Nothing unusual about that - except that my ship is currently at Anse Casse-Bois. Until now, if you moor at a beach and then walk into town, neither the store nor street traders have items for sale, and the street traders don't have any money which means you can't sell items either.
After some serious digging involving adding loads of 'trace' commands into both "items_utilite.c" and "Towntable.c", I think I've finally fixed it. This part of function "TownUpdate" seems to be the problem:
Code:
TownID = GetTownIDFromLocID(Characters[GetMainCharacterIndex()].location.from_sea);
if(TownID == ctown.id)
{
flt = true;
ctown.fleetsinport.pchar = true;
}
// LDH 29Mar09
if (TownID == "")
{
ref pchar = GetMainCharacter();
string island = "";
if (pchar.location.from_sea != "")
island = FindIslandByLocation(pchar.location.from_sea);
if (island != "")
TownID = GetAttribute(FindIsland(island),"towns.1"); // PB: For islands with no towns
}
Second, 'GetAttribute(FindIsland(island),"towns.1")' isn't going to work because 'FindIsland' returns an integer (the island's index). That should probably be 'GetAttribute(GetIslandByID(island),"towns.1")'.
Testing so far looks good - I've landed at beaches on Guadeloupe, Puerto Rico and Barbados, walked into town and been able to trade with street vendors. If you want to test this, download this version of "PROGRAM\Towns\Towntable.c".