mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fix toxbox movement
This commit is contained in:
parent
053773c06e
commit
04a26fce03
1 changed files with 3 additions and 2 deletions
|
|
@ -2722,13 +2722,14 @@ s32 cur_obj_progress_direction_table(void) {
|
||||||
if (!table) { return 0; }
|
if (!table) { return 0; }
|
||||||
|
|
||||||
s32 tableLength = 0;
|
s32 tableLength = 0;
|
||||||
while (table[tableLength] != -1 && tableLength < 50) {
|
while (table[tableLength] != -1 && tableLength < 150) {
|
||||||
tableLength++;
|
tableLength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tableLength >= 50 || index >= tableLength) {
|
if (tableLength < 0 || index < 0 || tableLength >= 150 || index >= tableLength) {
|
||||||
ret = table[0];
|
ret = table[0];
|
||||||
o->oToxBoxMovementStep = 0;
|
o->oToxBoxMovementStep = 0;
|
||||||
|
LOG_ERROR("Exceeded direction table! tableLength %d, index %d\n", tableLength, index);
|
||||||
} else if (table[index] != -1) {
|
} else if (table[index] != -1) {
|
||||||
ret = table[index];
|
ret = table[index];
|
||||||
o->oToxBoxMovementStep++;
|
o->oToxBoxMovementStep++;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue