unhardcode a lot of GWPlayer->items for loop accesses (#612)

This commit is contained in:
Rainchus 2025-11-28 22:15:16 -06:00 committed by GitHub
parent 3930e67e4f
commit 413d1b0529
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 144 additions and 123 deletions

View File

@ -13,6 +13,26 @@
#include "game/board/space.h"
#include "game/board/ui.h"
enum {
BOARD_ITEM_NONE = -1,
BOARD_ITEM_MINI_MUSHROOM = 0,
BOARD_ITEM_MEGA_MUSHROOM = 1,
BOARD_ITEM_SUPER_MINI_MUSHROOM = 2,
BOARD_ITEM_SUPER_MEGA_MUSHROOM = 3,
BOARD_ITEM_MINI_MEGA_HAMMER = 4,
BOARD_ITEM_WARP_PIPE = 5,
BOARD_ITEM_SWAP_CARD = 6,
BOARD_ITEM_SPARKY_STICKER = 7,
BOARD_ITEM_GADDLIGHT = 8,
BOARD_ITEM_CHOMP_CALL = 9,
BOARD_ITEM_BOWSER_SUIT = 10,
BOARD_ITEM_BOOS_CRYSTAL_BALL = 11,
BOARD_ITEM_MAGIC_LAMP = 12,
SHOP_ITEMS_END = BOARD_ITEM_MAGIC_LAMP,
BOARD_ITEM_ITEM_BAG = 13,
BOARD_ITEMS_END
};
extern s16 boardPlayerMdl[4];
static inline s32 BoardPlayerHandicapGet(s32 player)

View File

@ -3,6 +3,13 @@
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
//a bit of a hack to get the size of a member from a struct type
#define MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
//a bit of a hack to get the array count of a member from a struct type
#define ARRAY_COUNT_OF_MEMBER(type, member) \
(sizeof(((type *)0)->member) / sizeof(((type *)0)->member[0]))
#include "dolphin/types.h"
#endif

View File

@ -1,23 +1,24 @@
#include "REL/w02Dll.h"
#include "game/frand.h"
#include "game/board/player.h"
// Temporary defines
#define BOARD_ITEM_MINI 0x0
#define BOARD_ITEM_MEGA 0x1
#define BOARD_ITEM_SUPERMINI 0x2
#define BOARD_ITEM_SUPERMEGA 0x3
#define BOARD_ITEM_HAMMER 0x4
#define BOARD_ITEM_PIPE 0x5
#define BOARD_ITEM_CARD 0x6
#define BOARD_ITEM_SPARKY 0x7
#define BOARD_ITEM_GADDLIGHT 0x8
#define BOARD_ITEM_CHOMPCALL 0x9
#define BOARD_ITEM_SUIT 0xA
#define BOARD_ITEM_BOO 0xB
#define BOARD_ITEM_LAMP 0xC
#define BOARD_ITEM_BAG 0xD
#define BOARD_ITEM_MAX 0xE
#define BOARD_ITEM_NONE -1
// // Temporary defines
// #define BOARD_ITEM_MINI 0x0
// #define BOARD_ITEM_MEGA 0x1
// #define BOARD_ITEM_SUPERMINI 0x2
// #define BOARD_ITEM_SUPERMEGA 0x3
// #define BOARD_ITEM_HAMMER 0x4
// #define BOARD_ITEM_PIPE 0x5
// #define BOARD_ITEM_CARD 0x6
// #define BOARD_ITEM_SPARKY 0x7
// #define BOARD_ITEM_GADDLIGHT 0x8
// #define BOARD_ITEM_CHOMPCALL 0x9
// #define BOARD_ITEM_SUIT 0xA
// #define BOARD_ITEM_BOO 0xB
// #define BOARD_ITEM_LAMP 0xC
// #define BOARD_ITEM_BAG 0xD
// #define BOARD_ITEM_MAX 0xE
// #define BOARD_ITEM_NONE -1
/* BSS */
s16 lbl_1_bss_30[0x10]; // Model List
@ -26,7 +27,7 @@ s16 lbl_1_bss_2C;
Vec lbl_1_bss_20;
Vec lbl_1_bss_14;
s32 *lbl_1_bss_10;
s16 lbl_1_bss_8[4]; // Item List
s16 lbl_1_bss_8[ARRAY_COUNT(GWPlayer->items)]; // Item List
Process *lbl_1_bss_4;
u8 *lbl_1_bss_0;
@ -341,10 +342,10 @@ void fn_1_C50(void)
the first item is MINI_MUSHROOM and the
other two are not BOWSER_SUIT or ITEM_BAG.
*/
lbl_1_bss_8[0] = BOARD_ITEM_MINI;
for (i = 1; i < 3;) {
lbl_1_bss_8[i] = frandmod(BOARD_ITEM_MAX);
if (lbl_1_bss_8[i] != BOARD_ITEM_SUIT && lbl_1_bss_8[i] != BOARD_ITEM_BAG) {
lbl_1_bss_8[0] = BOARD_ITEM_MINI_MUSHROOM;
for (i = 1; i < ARRAY_COUNT(lbl_1_bss_8);) {
lbl_1_bss_8[i] = frandmod(BOARD_ITEMS_END);
if (lbl_1_bss_8[i] != BOARD_ITEM_BOWSER_SUIT && lbl_1_bss_8[i] != BOARD_ITEM_ITEM_BAG) {
for (j = 0; j < i; j++) {
if (lbl_1_bss_8[i] == lbl_1_bss_8[j]) {
lbl_1_bss_8[i] = BOARD_ITEM_NONE;
@ -396,7 +397,7 @@ void fn_1_C50(void)
while (GWPlayer[currPlayer].moving) {
HuPrcVSleep();
}
BoardPlayerMotionStart((s32)currPlayer, 1, 0x40000001);
BoardPlayerMotionStart(currPlayer, 1, 0x40000001);
BoardPlayerMotBlendSet(currPlayer, 0xB4, 0xF);
while (BoardPlayerMotBlendCheck(currPlayer) == 0) {
HuPrcVSleep();
@ -411,7 +412,7 @@ void fn_1_C50(void)
HuPrcVSleep();
}
fn_1_5F90();
BoardPlayerMotionStart((s32)currPlayer, 1, 0x40000001);
BoardPlayerMotionStart(currPlayer, 1, 0x40000001);
HuPrcEnd();
}

View File

@ -321,11 +321,11 @@ static s8 lbl_1_data_27F[4][2] = {
};
static s32 fn_1_7944(s32 arg0) {
s8 spB[3];
s8 sp8[3];
s8 spB[ARRAY_COUNT(GWPlayer->items)];
s8 sp8[ARRAY_COUNT(GWPlayer->items)];
s32 var_r25;
s32 temp_r26;
s32 var_r30;
s32 itemCount;
s32 temp_r27;
s32 var_r31;
s32 i;
@ -334,18 +334,18 @@ static s32 fn_1_7944(s32 arg0) {
if (var_r25 == 0) {
return -1;
}
for (var_r30 = i = 0; i < 3; i++) {
for (itemCount = i = 0; i < ARRAY_COUNT(GWPlayer->items); i++) {
temp_r26 = GWPlayer[arg0].items[i];
if (temp_r26 != -1) {
spB[var_r30] = temp_r26;
sp8[var_r30] = i;
var_r30++;
if (temp_r26 != BOARD_ITEM_NONE) {
spB[itemCount] = temp_r26;
sp8[itemCount] = i;
itemCount++;
}
}
if (var_r30 == 0) {
if (itemCount == 0) {
return -1;
}
if (var_r30 == 1) {
if (itemCount == 1) {
return 0;
}
temp_r27 = BoardRandMod(100);
@ -360,13 +360,13 @@ static s32 fn_1_7944(s32 arg0) {
} else {
var_r31 = 1;
}
if (var_r30 == 3) {
if (lbl_1_data_26D[spB[var_r31]] > lbl_1_data_26D[spB[2]]) {
if (itemCount == ARRAY_COUNT(GWPlayer->items)) {
if (lbl_1_data_26D[spB[var_r31]] > lbl_1_data_26D[spB[2]]) { //TODO: spB[ARRAY_COUNT(GWPlayer->items)-1] ?
if (lbl_1_data_27F[GWPlayer[arg0].rank][1] > temp_r27) {
var_r31 = 2;
var_r31 = 2; //TODO: var_r31 = ARRAY_COUNT(GWPlayer->items)-1 ?
}
} else if (lbl_1_data_27F[GWPlayer[arg0].rank][1] < temp_r27) {
var_r31 = 2;
var_r31 = 2; //TODO: var_r31 = ARRAY_COUNT(GWPlayer->items)-1 ?
}
}
var_r31 = sp8[var_r31];

View File

@ -30,23 +30,6 @@ static BOOL CheckLampUse(s32 player, s32 item);
static s8 itemUse = -1;
#define BOARD_ITEM_MINI_MUSHROOM 0
#define BOARD_ITEM_MEGA_MUSHROOM 1
#define BOARD_ITEM_SUPER_MINI_MUSHROOM 2
#define BOARD_ITEM_SUPER_MEGA_MUSHROOM 3
#define BOARD_ITEM_MINI_MEGA_HAMMER 4
#define BOARD_ITEM_WARP_PIPE 5
#define BOARD_ITEM_SWAP_CARD 6
#define BOARD_ITEM_SPARKY_STICKER 7
#define BOARD_ITEM_GADDLIGHT 8
#define BOARD_ITEM_CHOMP_CALL 9
#define BOARD_ITEM_BOWSER_SUIT 10
#define BOARD_ITEM_BOOS_CRYSTAL_BALL 11
#define BOARD_ITEM_MAGIC_LAMP 12
#define SHOP_ITEMS_END BOARD_ITEM_MAGIC_LAMP
#define BOARD_ITEM_ITEM_BAG 13
#define BOARD_ITEMS_END BOARD_ITEM_ITEM_BAG
static s8 comItemPreferTbl[CHARNO_MAX ][SHOP_ITEMS_END] = {
{ //Mario
BOARD_ITEM_MAGIC_LAMP,

View File

@ -1019,7 +1019,7 @@ static void ExecItemSwap(void)
}
BoardModelRotSetV(suitMdl, &spA8);
var_r23 = var_r22 = 0;
for (var_r31 = 0; var_r31 < 3; var_r31++) {
for (var_r31 = 0; var_r31 < ARRAY_COUNT(GWPlayer->items); var_r31++) {
if (GWPlayer[currItemRestore].items[var_r31] != -1) {
var_r23++;
}

View File

@ -1837,7 +1837,7 @@ static void ExecPrize(void) {
temp_r30 = GWSystem.player_curr;
BoardStatusShowSetForce(temp_r30);
BoardStatusShowSet(temp_r30, 1);
for (var_r24 = i = 0; i < 3; i++) {
for (var_r24 = i = 0; i < ARRAY_COUNT(GWPlayer->items); i++) {
if (GWPlayer[GWSystem.player_curr].items[i] != -1) {
var_r24++;
}

View File

@ -260,7 +260,7 @@ void BoardPlayerInit(void)
void BoardPlayerModelInit(void)
{
s32 var_r31;
s32 var_r30;
s32 i;
s32 temp_r29;
s32 temp_r25;
s32 temp_r24;
@ -298,19 +298,18 @@ void BoardPlayerModelInit(void)
GWPlayer[var_r31].character = temp_r29;
GWPlayerCfg[var_r31].character = temp_r29;
for (var_r30 = 0; var_r30 < ARRAY_COUNT(ro2); var_r30++) {
sp64[var_r30] = ro1[temp_r29] | ro2[var_r30];
for (i = 0; i < ARRAY_COUNT(ro2); i++) {
sp64[i] = ro1[temp_r29] | ro2[i];
}
sp64[var_r30] = -1;
sp64[i] = -1;
temp_r3 = BoardModelCreateCharacter(temp_r29, ro0[temp_r29], sp64, 0);
boardPlayerMdl[var_r31] = temp_r3;
BoardPlayerCopyMat(var_r31);
playerMot[var_r31] = 1;
BoardModelMotionStart(temp_r3, playerMot[var_r31], 0x40000001);
if (BoardStartCheck() == 0) {
for (var_r30 = 0; var_r30 < ARRAY_COUNT(temp_r27->items); var_r30++) {
temp_r27->items[var_r30] = -1;
for (i = 0; i < ARRAY_COUNT(temp_r27->items); i++) {
temp_r27->items[i] = BOARD_ITEM_NONE;
}
temp_r24 = GWPlayerCfg[var_r31].group;
GWPlayer[var_r31].team = temp_r24;
@ -335,21 +334,21 @@ void BoardPlayerModelInit(void)
void BoardPlayerModelKill(void)
{
s32 var_r31;
PlayerState *temp_r30;
PlayerState *temp_r29;
s32 i;
for (var_r31 = 0; var_r31 < 4; var_r31++) {
temp_r30 = BoardPlayerGet(var_r31);
for (i = 0; i < 4; i++) {
temp_r30 = BoardPlayerGet(i);
if (boardPlayerMdl[temp_r30->player_idx] != -1) {
BoardModelKill(boardPlayerMdl[temp_r30->player_idx]);
boardPlayerMdl[temp_r30->player_idx] = -1;
}
if (playerMatCopy[var_r31] != 0) {
HuMemDirectFree(playerMatCopy[var_r31]);
playerMatCopy[var_r31] = 0;
if (playerMatCopy[i] != 0) {
HuMemDirectFree(playerMatCopy[i]);
playerMatCopy[i] = 0;
}
BoardBowserSuitKill(var_r31);
BoardBowserSuitKill(i);
}
}
@ -386,8 +385,8 @@ s32 BoardPlayerItemAdd(s32 arg0, s32 arg1)
var_r29 = -1;
var_r30 = BoardPlayerGet(arg0);
for (var_r31 = 0; var_r31 < 3; var_r31++) {
if (GWPlayer[arg0].items[var_r31] == -1) {
for (var_r31 = 0; var_r31 < ARRAY_COUNT(GWPlayer[arg0].items); var_r31++) {
if (GWPlayer[arg0].items[var_r31] == BOARD_ITEM_NONE) {
HuAudFXPlay(0x360);
var_r30->items[var_r31] = arg1;
BoardItemStatusKill(arg0);
@ -405,7 +404,7 @@ s32 BoardPlayerItemRemove(s32 arg0, s32 arg1)
temp_r28 = BoardPlayerGet(arg0);
temp_r29 = temp_r28->items[arg1];
if (temp_r28->items[arg1] == -1) {
if (temp_r28->items[arg1] == BOARD_ITEM_NONE) {
return temp_r29;
}
if (arg1 == 0) {
@ -414,20 +413,25 @@ s32 BoardPlayerItemRemove(s32 arg0, s32 arg1)
if ((arg1 == 1) || (arg1 == 0)) {
temp_r28->items[1] = temp_r28->items[2];
}
temp_r28->items[2] = -1;
temp_r28->items[2] = BOARD_ITEM_NONE;
HuAudFXPlay(0x363);
BoardItemStatusKill(arg0);
return temp_r29;
}
// Return the inventory slot in a player's inventory that contains an item.
// Returns -1 if the player does not have the item.
s32 BoardPlayerItemFind(s32 player, s32 item)
/**
* Finds the inventory slot containing an item for a player.
*
* @param playerNo Player index.
* @param item Item ID to search for.
* @return Slot index if found, otherwise -1.
*/
s32 BoardPlayerItemFind(s32 playerNo, s32 item)
{
s32 inv_slot;
for (inv_slot = 0; inv_slot < ARRAY_COUNT(GWPlayer[player].items); inv_slot++) {
if (item == GWPlayer[player].items[inv_slot]) {
for (inv_slot = 0; inv_slot < ARRAY_COUNT(GWPlayer[playerNo].items); inv_slot++) {
if (item == GWPlayer[playerNo].items[inv_slot]) {
return inv_slot;
}
}
@ -435,18 +439,24 @@ s32 BoardPlayerItemFind(s32 player, s32 item)
return -1;
}
s32 BoardPlayerItemCount(s32 arg0)
/**
* Counts how many items a player has
*
* @param playerNo Player index.
* @return Total item count
*/
s32 BoardPlayerItemCount(s32 playerNo)
{
s32 var_r30;
s32 var_r31;
s32 itemCount;
s32 i;
for (var_r31 = 0, var_r30 = var_r31; var_r31 < 3; var_r31++) {
if (GWPlayer[arg0].items[var_r31] != -1) {
var_r30++;
for (i = 0, itemCount = i; i < ARRAY_COUNT(GWPlayer[playerNo].items); i++) {
if (GWPlayer[playerNo].items[i] != BOARD_ITEM_NONE) {
itemCount++;
}
}
return var_r30;
return itemCount;
}
void BoardPlayerCornerPosSet(s32 arg0)

View File

@ -135,7 +135,7 @@ static void UpdateItemWindow(omObjData *arg0);
static void CreatePickerWindow(UnkUiWork01 *arg0, s32 arg1);
static void KillPickerWindow(UnkUiWork01 *arg0);
static s16 itemMdlId[4][3];
static s16 itemMdlId[4][ARRAY_COUNT(GWPlayer->items)];
static Vec pickerPos[4];
static Vec itemPosTemp[6];
@ -150,7 +150,7 @@ static s16 yourTurnSpr;
static s8 itemPlayer;
static s8 itemUsed;
static s8 teamItemPlayer;
static s16 itemRandTbl[3];
static s16 itemRandTbl[ARRAY_COUNT(GWPlayer->items)];
static float itemPickupPos;
static omObjData *itemPickObj;
static Process *itemUseProc;
@ -225,9 +225,9 @@ static float statusSprPosTbl[17][2] = {
static float statusItemPosTbl[6][2] = {
{ -56.0f, 0.0f },
{ -58.0f, 32.0f },
{ -2.0f, 4.0f },
{ 34.0f, -8.0f },
{ 70.0f, 4.0f },
{ -2.0f, 4.0f }, //item 0 pos
{ 34.0f, -8.0f }, //item 1 pos
{ 70.0f, 4.0f }, //item 2 pos
{ -56.0f, -16.0f }
};
@ -324,7 +324,7 @@ void BoardStatusItemSet(s32 arg0) {
temp_r31->unk04.y = temp_r31->unk10.y;
temp_r31->unk00_bit2 = 0;
HuSprGrpPosSet(temp_r31->unk02, temp_r31->unk04.x, temp_r31->unk04.y);
for (j = 0; j < 3; j++) {
for (j = 0; j < ARRAY_COUNT(GWPlayer->items); j++) {
if (itemMdlId[i][j] != -1) {
BoardModelVisibilitySet(itemMdlId[i][j], arg0);
}
@ -614,7 +614,7 @@ static s32 UpdateBoardStatus(void) {
HuSprBankSet(temp_r31->unk02, 2, GWPlayer[i].rank);
BoardSpriteDigitUpdate(temp_r31->unk02, 3, BoardPlayerCoinsGet(i));
BoardSpriteDigitUpdate(temp_r31->unk02, 7, GWStarsGet(i));
for (j = 0; j < 3; j++) {
for (j = 0; j < ARRAY_COUNT(GWPlayer->items); j++) {
temp_r27 = GWPlayer[i].items[j];
if (temp_r27 != -1 && temp_r31->unk00_bit5) {
UpdateStatusItem(temp_r31, j, temp_r27);
@ -1061,10 +1061,10 @@ static void ItemUseProc(void) {
s32 var_r24;
s16 temp_r23;
s32 var_r25;
s32 var_r27;
s32 dataDir;
s32 i;
var_r27 = -1;
dataDir = -1;
itemTeam = GWPlayerTeamGet(itemPlayer);
if (GWTeamGet()) {
itemTeamF = 1;
@ -1074,31 +1074,31 @@ static void ItemUseProc(void) {
for (i = 0; i < 4; i++) {
GWPlayer[i].show_next = 0;
}
for (var_r25 = i = 0; i < 3; i++) {
if (GWPlayer[itemPlayer].items[i] == 8) {
for (var_r25 = i = 0; i < ARRAY_COUNT(GWPlayer->items); i++) {
if (GWPlayer[itemPlayer].items[i] == BOARD_ITEM_GADDLIGHT) {
var_r25++;
}
}
temp_r23 = GWPlayer[itemPlayer].space_curr;
ItemUseTeamProc(1);
BoardFilterFadeInit(0x1E, 0xA0);
BoardFilterFadeInit(30, 0xA0);
ExecItemPick();
ItemUseTeamProc(0);
itemTeamF = 0;
BoardFilterFadeOut(0x1E);
if (itemUsed == 0xA) {
var_r27 = DATADIR_BKOOPASUIT;
BoardFilterFadeOut(30);
if (itemUsed == BOARD_ITEM_BOWSER_SUIT) {
dataDir = DATADIR_BKOOPASUIT;
}
if (itemUsed == 0xB) {
var_r27 = DATADIR_BYOKODORI;
if (itemUsed == BOARD_ITEM_BOOS_CRYSTAL_BALL) {
dataDir = DATADIR_BYOKODORI;
}
if (var_r27 != -1) {
var_r24 = BoardDataDirReadAsync(var_r27);
if (dataDir != -1) {
var_r24 = BoardDataDirReadAsync(dataDir);
BoardDataAsyncWait(var_r24);
}
HideItemWindow();
BoardItemPrevSet(itemUsed);
if (itemUsed != -1) {
if (itemUsed != BOARD_ITEM_NONE) {
switch (itemUsed) {
case 13:
BoardMakeRandomItem();
@ -1123,7 +1123,7 @@ static void ItemUseProc(void) {
}
FinishItemUse(temp_r23, var_r25);
}
if (itemUsed != 0xB && itemUsed != 0xC) {
if (itemUsed != BOARD_ITEM_BOOS_CRYSTAL_BALL && itemUsed != BOARD_ITEM_MAGIC_LAMP) {
SetItemUIStatus(3);
}
while (itemPickObj) {
@ -1137,7 +1137,7 @@ static void ItemUseProc(void) {
static void FinishItemUse(s16 arg0, s32 arg1) {
s32 var_r30;
s32 var_r31;
s32 i;
s16 temp_r29;
switch (itemUsed) {
@ -1159,13 +1159,13 @@ static void FinishItemUse(s16 arg0, s32 arg1) {
BoardPlayerSparkSet(itemPlayer);
break;
case 8:
for (var_r30 = var_r31 = 0; var_r31 < 3; var_r31++) {
if (GWPlayer[itemPlayer].items[var_r31] == 8) {
for (var_r30 = i = 0; i < ARRAY_COUNT(GWPlayer->items); i++) {
if (GWPlayer[itemPlayer].items[i] == BOARD_ITEM_GADDLIGHT) {
var_r30++;
}
}
if (var_r30 == arg1) {
itemUsed = -1;
itemUsed = BOARD_ITEM_NONE;
}
break;
}
@ -1187,9 +1187,9 @@ void BoardMakeRandomItem(void) {
s32 chosenItemIndex;
s32 i;
for (i = 0; i < 3; i++) {
chosenItemIndex = BoardRandMod(0xE);
if (chosenItemIndex != 0xA && chosenItemIndex != 0xD) {
for (i = 0; i < ARRAY_COUNT(itemRandTbl); i++) {
chosenItemIndex = BoardRandMod(BOARD_ITEMS_END);
if (chosenItemIndex != BOARD_ITEM_BOWSER_SUIT && chosenItemIndex != BOARD_ITEM_ITEM_BAG) {
itemRandTbl[i] = chosenItemIndex;
}
}
@ -1229,9 +1229,9 @@ static inline void ExecItemPickInlineFunc01(Vec (*arg0)[6]) {
s32 j;
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (j = 0; j < ARRAY_COUNT(GWPlayer->items); j++) {
sp14 = GWPlayer[i].items[j];
if (sp14 == -1) {
if (sp14 == BOARD_ITEM_NONE) {
itemMdlId[i][j] = -1;
} else {
BoardCameraRotGet(&sp1C);
@ -1312,7 +1312,7 @@ static void ExecItemPick(void) {
sp40.x = statusPosTbl[i][0];
sp40.y = statusPosTbl[i][1];
}
for (j = 0; j < 6; j++) {
for (j = 0; j < ARRAY_COUNT(statusItemPosTbl); j++) {
temp_r28[i][j].x = statusSprPosTbl[j + 0xB][0];
temp_r28[i][j].y = statusSprPosTbl[j + 0xB][1];
(temp_r28 + 4)[i][j].x = statusItemPosTbl[j][0];
@ -1490,7 +1490,7 @@ static void SetItemUIStatus(s32 arg0) {
for (i = 0; i < 4; i++) {
var_f31 = statusPosTbl[i][0];
var_f30 = statusPosTbl[i][1];
for (j = 0; j < 6; j++) {
for (j = 0; j < ARRAY_COUNT(statusItemPosTbl); j++) {
(temp_r28 + 4)[i][j].x = statusItemPosTbl[j][0];
(temp_r28 + 4)[i][j].y = statusItemPosTbl[j][1];
if ((j >= 2) && (j <= 4)) {
@ -1565,7 +1565,7 @@ void BoardItemStatusKill(s32 arg0) {
sp8.y = statusPosTbl[arg0][1];
}
sp8.z = 0.0f;
for (i = 0; i < 3; i++) {
for (i = 0; i < ARRAY_COUNT(GWPlayer->items); i++) {
VECAdd((Vec*) statusItemPosTbl[i + 2], &sp8, &sp68[i]);
if (itemMdlId[arg0][i] != -1) {
BoardModelRotGet(itemMdlId[arg0][i], &sp44[i]);
@ -1574,9 +1574,9 @@ void BoardItemStatusKill(s32 arg0) {
itemMdlId[arg0][i] = -1;
}
}
for (i = 0; i < 3; i++) {
for (i = 0; i < ARRAY_COUNT(GWPlayer->items); i++) {
temp_r25 = GWPlayer[arg0].items[i];
if (temp_r25 != -1) {
if (temp_r25 != BOARD_ITEM_NONE) {
temp_r28 = BoardModelCreate(itemMdlTbl[temp_r25], 0, 0);
itemMdlId[arg0][i] = temp_r28;
BoardCameraRotGet(&sp14);
@ -1811,7 +1811,7 @@ static void CreateItemWindow(s32 arg0, s32 arg1) {
var_r27 -= BoardPlayerItemCount(itemPlayer);
}
temp_r28 = GWPlayer[arg0].items[var_r27];
if (temp_r28 == -1) {
if (temp_r28 == BOARD_ITEM_NONE) {
temp_r31->unk12[i] = temp_r31->unk1E[i]
= temp_r31->unk06[i] = temp_r31->unk00[i] = -1;
} else {