03.04.2015, 19:57
The code:
The backtrace.
The problematic line:
Declaration of array and its enum:
Also I was unable to get the same result on my local server. For some reasons it only appears in my VPS. I think it might be due to the number of players although I dont yet see how can that be the case.
By googling I already added checks for invalid indexes, they do not appear. What else could cause this? I'm quite desperete, so ANY ideas at all will be appreciated.
pawn Код:
stock GetBusinessFurnitureCount(bizindex)
{
new count = 0;
for(new i = 0; i < MAX_BUSINESS_FURNITURE; i++)
{
if(i < 0 || i >= MAX_BUSINESS_FURNITURE || bizindex < 0 || bizindex >= MAX_BIZNES)
printf("GetBusinessFurnitureCount(%d) is invalid index. i:%d", bizindex, i);
if(BusinessFurniture[ bizindex ][ i ][ SqlId ])
count++;
}
return count;
}
pawn Код:
[19:25:40] [debug] Run time error 5: "Invalid memory access"
[19:25:40] [debug] AMX backtrace:
[19:25:40] [debug] #0 00064e64 in GetBusinessFurnitureCount (bizindex=29) at Property\Businesses.p:1306
pawn Код:
if(BusinessFurniture[ bizindex ][ i ][ SqlId ])
pawn Код:
enum E_BUSINESS_FURNITURE_DATA {
SqlId,
FurnitureId,
ObjectId,
Name[ MAX_FURNITURE_NAME]
};
new BusinessFurniture[ MAX_BIZNES ][ MAX_BUSINESS_FURNITURE ][ E_BUSINESS_FURNITURE_DATA ];
By googling I already added checks for invalid indexes, they do not appear. What else could cause this? I'm quite desperete, so ANY ideas at all will be appreciated.