Rename some g_Vars properties

This commit is contained in:
Ryan Dwyer
2019-10-26 13:37:00 +10:00
parent 30d2040bbb
commit 7784f26b46
3 changed files with 16 additions and 17 deletions
+4 -4
View File
@@ -15818,14 +15818,14 @@ glabel ai01b3
//{
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
//
// if (g_Vars.unk000298 >= 0) {
// if (g_Vars.coopplayernum >= 0) {
// struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]);
//
// if (chr) {
// if (((u32)chr->BITFIELD >> 14) == g_Vars.unk000294 && g_Vars.coop->unkd8 == 0) {
// chr->bitfielddata.unk32e = (g_Vars.unk000298 << 6) | (chr->bitfielddata.unk32e & 0xff3f);
// if (((u32)chr->BITFIELD >> 14) == g_Vars.bondplayernum && g_Vars.coop->unkd8 == 0) {
// chr->bitfielddata.unk32e = (g_Vars.coopplayernum << 6) | (chr->bitfielddata.unk32e & 0xff3f);
// } else if (g_Vars.bond->unkd8 == 0) {
// chr->bitfielddata.unk32e = (g_Vars.unk000294 << 6) | (chr->bitfielddata.unk32e & 0xff3f);
// chr->bitfielddata.unk32e = (g_Vars.bondplayernum << 6) | (chr->bitfielddata.unk32e & 0xff3f);
// }
// }
// }
+7 -7
View File
@@ -84287,16 +84287,16 @@ s32 chrResolveId(struct chrdata *ref, s32 id)
break;
case 0xf2:
{
u32 index = g_Vars.unk000298 >= 0 ? (u32)ref->BITFIELD >> 14 : g_Vars.unk000294;
struct player *player = g_Vars.unk000064[index];
u32 index = g_Vars.coopplayernum >= 0 ? (u32)ref->BITFIELD >> 14 : g_Vars.bondplayernum;
struct player *player = g_Vars.players[index];
if (player && player->unkbc && player->unkbc->chr) {
id = player->unkbc->chr->chrnum;
}
}
break;
case 0xf1:
if (g_Vars.unk000298 >= 0) {
struct player *player = g_Vars.unk000064[1 - ((u32)ref->BITFIELD >> 14)];
if (g_Vars.coopplayernum >= 0) {
struct player *player = g_Vars.players[1 - ((u32)ref->BITFIELD >> 14)];
if (player && player->unkbc && player->unkbc->chr) {
id = player->unkbc->chr->chrnum;
}
@@ -84330,15 +84330,15 @@ s32 chrResolveId(struct chrdata *ref, s32 id)
break;
case 0xf2: // P1/P2
{
struct player *player = g_Vars.unk000064[g_Vars.unk000294];
struct player *player = g_Vars.players[g_Vars.bondplayernum];
if (player && player->unkbc && player->unkbc->chr) {
id = player->unkbc->chr->chrnum;
}
}
break;
case 0xf1: // P1/P2 inverse?
if (g_Vars.unk000298 >= 0) {
struct player *player = g_Vars.unk000064[g_Vars.unk000298];
if (g_Vars.coopplayernum >= 0) {
struct player *player = g_Vars.players[g_Vars.coopplayernum];
if (player && player->unkbc && player->unkbc->chr) {
id = player->unkbc->chr->chrnum;
}
+5 -6
View File
@@ -2,14 +2,13 @@
#include "types.h"
struct g_vars {
// Known member names based on debug strings:
// Known remaining member names based on debug strings:
//g_Vars.PaksNeedsReInit
//g_Vars.FourMeg2Player
//g_Vars.playersperm[0]
//g_Vars.playersperm[1]
//g_Vars.PropState.propznum
//g_Vars.PropState
//g_Vars.antiplayernum
//g_Vars.antiradaron
//g_Vars.antibodynum
//g_Vars.antiheadnum
@@ -41,7 +40,7 @@ struct g_vars {
/*000058*/ u32 unk000058;
/*00005c*/ u32 unk00005c;
/*000060*/ u32 unk000060;
/*000064*/ struct player *unk000064[2];
/*000064*/ struct player *players[2];
/*00006c*/ u32 unk00006c;
/*000070*/ u32 unk000070;
/*000074*/ u32 unk000074;
@@ -180,9 +179,9 @@ struct g_vars {
/*000288*/ u32 unk000288;
/*00028c*/ u32 currentplayernum;
/*000290*/ u32 unk000290;
/*000294*/ s32 unk000294; // suspected 0-3 to indicate bond controller number
/*000298*/ s32 unk000298; // suspected 0-3 to indicate coop controller number
/*00029c*/ s32 unk00029c; // suspected 0-3 to indicate anti controller number
/*000294*/ s32 bondplayernum; // suspected 0-3 to indicate bond controller number
/*000298*/ s32 coopplayernum;
/*00029c*/ s32 antiplayernum;
/*0002a0*/ struct player *bond;
/*0002a4*/ struct player *coop; // Co-op buddy when controlled by human
/*0002a8*/ struct player *anti; // Counter-op