diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 1603b12f1..6ba904b6b 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -7218,7 +7218,7 @@ glabel aiRevokeControl /* f057588: 30490002 */ andi $t1,$v0,0x2 /* f05758c: 55200006 */ bnezl $t1,.L0f0575a8 /* f057590: 304b0004 */ andi $t3,$v0,0x4 -/* f057594: 0fc37e8e */ jal func0f0dfa38 +/* f057594: 0fc37e8e */ jal currentPlayerSetFlag /* f057598: 24040002 */ addiu $a0,$zero,0x2 /* f05759c: 8faa002c */ lw $t2,0x2c($sp) /* f0575a0: 91420003 */ lbu $v0,0x3($t2) @@ -7260,7 +7260,7 @@ glabel aiRevokeControl // func0f0a95ec(2, false); // // if ((cmd[3] & 2) == 0) { -// func0f0dfa38(2); +// currentPlayerSetFlag(PLAYERFLAG_NOCONTROL); // } // // if ((cmd[3] & 4) == 0) { @@ -7289,7 +7289,7 @@ bool aiGrantControl(void) setCurrentPlayerNum(propGetPlayerNum(chr->prop)); func0f0abc74(4, true); func0f0a95ec(2, true); - func0f0dfa1c(2); + currentPlayerUnsetFlag(PLAYERFLAG_NOCONTROL); countdownTimerSetVisible(16, true); g_PlayersWithControl[g_Vars.currentplayernum] = true; setCurrentPlayerNum(prevplayernum); diff --git a/src/game/game_0b28d0.c b/src/game/game_0b28d0.c index a15e0f052..c4c748bb6 100644 --- a/src/game/game_0b28d0.c +++ b/src/game/game_0b28d0.c @@ -5672,7 +5672,7 @@ glabel func0f0b72dc /* f0b73b4: 8e4a0284 */ lw $t2,0x284($s2) /* f0b73b8: ad4016d8 */ sw $zero,0x16d8($t2) /* f0b73bc: 8e4c0284 */ lw $t4,0x284($s2) -/* f0b73c0: 0fc37e87 */ jal func0f0dfa1c +/* f0b73c0: 0fc37e87 */ jal currentPlayerUnsetFlag /* f0b73c4: ad8b17a4 */ sw $t3,0x17a4($t4) /* f0b73c8: 8e4d0284 */ lw $t5,0x284($s2) /* f0b73cc: 3c0141f0 */ lui $at,0x41f0 diff --git a/src/game/game_0dcdb0.c b/src/game/game_0dcdb0.c index ac9368973..0d37d2005 100644 --- a/src/game/game_0dcdb0.c +++ b/src/game/game_0dcdb0.c @@ -7459,26 +7459,15 @@ glabel func0f0df364 /* f0dfa18: 27bd0070 */ addiu $sp,$sp,0x70 ); -GLOBAL_ASM( -glabel func0f0dfa1c -/* f0dfa1c: 3c02800a */ lui $v0,0x800a -/* f0dfa20: 8c42a244 */ lw $v0,-0x5dbc($v0) -/* f0dfa24: 00807827 */ nor $t7,$a0,$zero -/* f0dfa28: 8c4e185c */ lw $t6,0x185c($v0) -/* f0dfa2c: 01cfc024 */ and $t8,$t6,$t7 -/* f0dfa30: 03e00008 */ jr $ra -/* f0dfa34: ac58185c */ sw $t8,0x185c($v0) -); +void currentPlayerUnsetFlag(u32 flag) +{ + g_Vars.currentplayer->flags &= ~flag; +} -GLOBAL_ASM( -glabel func0f0dfa38 -/* f0dfa38: 3c02800a */ lui $v0,0x800a -/* f0dfa3c: 8c42a244 */ lw $v0,-0x5dbc($v0) -/* f0dfa40: 8c4e185c */ lw $t6,0x185c($v0) -/* f0dfa44: 01c47825 */ or $t7,$t6,$a0 -/* f0dfa48: 03e00008 */ jr $ra -/* f0dfa4c: ac4f185c */ sw $t7,0x185c($v0) -); +void currentPlayerSetFlag(u32 flag) +{ + g_Vars.currentplayer->flags |= flag; +} GLOBAL_ASM( glabel func0f0dfa50 diff --git a/src/include/constants.h b/src/include/constants.h index 8b311324c..5057910c6 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -684,6 +684,8 @@ #define PATHTYPE_CIRCULAR 1 #define PATHTYPE_FLYING 2 +#define PLAYERFLAG_NOCONTROL 0x00000002 + #define PROPFLAG_HIDDEN 0x04 #define PROPTYPE_OBJ 1 diff --git a/src/include/game/game_0dcdb0.h b/src/include/game/game_0dcdb0.h index 4378926ff..3c136c1c4 100644 --- a/src/include/game/game_0dcdb0.h +++ b/src/include/game/game_0dcdb0.h @@ -21,8 +21,8 @@ u32 func0f0de160(void); u32 func0f0de7fc(void); u32 func0f0deebc(void); u32 func0f0df364(void); -void func0f0dfa1c(u32 arg0); -u32 func0f0dfa38(void); +void currentPlayerUnsetFlag(u32 flag); +void currentPlayerSetFlag(u32 flag); u32 func0f0dfa50(void); u32 func0f0dfad0(void); u32 func0f0e0724(void); diff --git a/src/include/types.h b/src/include/types.h index c68dc5a25..34696fd4f 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2253,7 +2253,7 @@ struct player { /*0x1850*/ u32 unk1850; /*0x1854*/ u32 unk1854; /*0x1858*/ u32 unk1858; - /*0x185c*/ u32 unk185c; + /*0x185c*/ u32 flags; /*0x1860*/ u32 unk1860; /*0x1864*/ u32 unk1864; /*0x1868*/ u32 unk1868;