27.09.2013, 23:48
I have the following code:
Output:
works a treat, but when i comment out the "print"s:
I get the following crash:
Any thoughts? thanks Grim.
Edit: The test data for both runs is Exactly the same, just to rule it out.
pawn Код:
print("CHECK_TWOPAIRS - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==2) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
return CHECK_TWOPAIRS;
}
}
}
}
}
print("CHECK_TWOPAIRS - END");
pawn Код:
[00:48:21] CHECK_TWOPAIRS - START
[00:48:21] CHECK_TWOPAIRS - END
pawn Код:
//print("CHECK_TWOPAIRS - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==2) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
return CHECK_TWOPAIRS;
}
}
}
}
}
//print("CHECK_TWOPAIRS - END");
pawn Код:
[00:50:55] [debug] Run time error 4: "Array index out of bounds"
[00:50:55] [debug] Accessing element at index 8685052 past array upper bound 4
[00:50:55] [debug] AMX backtrace:
[00:50:55] [debug] #0 00047c28 in ?? () from grimrandomerRoleplay.amx
[00:50:55] [debug] #1 000b81e4 in public OnGameModeInit () from grimrandomerRoleplay.amx
Edit: The test data for both runs is Exactly the same, just to rule it out.