fixed counter overflow error #304

This commit is contained in:
Blake Warner 2022-05-14 09:13:18 -04:00
parent 1f47f792c5
commit 384b638fb0
18 changed files with 68 additions and 68 deletions

View File

@ -379,7 +379,7 @@ class Timer
{
if(m_counterInt > m_max * m_counterScaler)
{
m_counterInt = (m_min * m_counterScaler) + (m_counterInt - (m_max * m_counterScaler + 1));
m_counterInt = (m_min * m_counterScaler) + (m_counterInt - ((m_max + 1) * m_counterScaler + 0));
if(m_counterInt > m_max * m_counterScaler)
{
@ -389,7 +389,7 @@ class Timer
if(m_counterInt < m_min * m_counterScaler)
{
m_counterInt = (m_max * m_counterScaler) + (m_counterInt - (m_min * m_counterScaler - 1));
m_counterInt = (m_max * m_counterScaler) + (m_counterInt - ((m_min - 1) * m_counterScaler - 0));
if(m_counterInt < m_min * m_counterScaler)
{

View File

@ -42,7 +42,7 @@ enum PlayerState2
PLAYER_STATE2_1 = 1 << 1, // 0x00000002
PLAYER_STATE2_2 = 1 << 2, // 0x00000004
PLAYER_STATE2_3 = 1 << 3, // 0x00000008
PLAYER_STATE2_4 = 1 << 4, // 0x00000010
PLAYER_STATE2_4_JYA_COBRA_TURNING = 1 << 4, // 0x00000010
PLAYER_STATE2_5 = 1 << 5, // 0x00000020
PLAYER_STATE2_REDIRECT_CONTROL = 1 << 6, // 0x00000040
PLAYER_STATE2_7 = 1 << 7, // 0x00000080

View File

@ -266,7 +266,7 @@ void BgGndIceblock_Idle(BgGndIceblock* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
if(pthis->dyna.unk_150 > 0.0f)
{
BgGndIceblock_SetNextPosition(pthis);
@ -287,7 +287,7 @@ void BgGndIceblock_Reset(BgGndIceblock* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
if(Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f))

View File

@ -80,7 +80,7 @@ void func_8087B7E8(BgHaka* pthis, GlobalContext* globalCtx)
if(globalCtx->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && !gSaveContext.nightFlag)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
if(!Gameplay_InCsMode(globalCtx))
{
Message_StartTextbox(globalCtx, 0x5073, NULL);
@ -91,7 +91,7 @@ void func_8087B7E8(BgHaka* pthis, GlobalContext* globalCtx)
else if(0.0f < pthis->dyna.unk_150 || (globalCtx->sceneNum == SCENE_SPOT06 && !LINK_IS_ADULT && !Flags_GetSwitch(globalCtx, 0x23)))
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
else
{
@ -115,7 +115,7 @@ void func_8087B938(BgHaka* pthis, GlobalContext* globalCtx)
if(sp38 != 0)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
if(pthis->dyna.actor.params == 1)
{
Common_PlaySfx(NA_SE_SY_CORRECT_CHIME);
@ -136,7 +136,7 @@ void func_8087BAAC(BgHaka* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}
@ -152,7 +152,7 @@ void func_8087BAE4(BgHaka* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
if(pthis->dyna.actor.params == 0)
{

View File

@ -198,7 +198,7 @@ void BgHakaGate_StatueInactive(BgHakaGate* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
@ -222,7 +222,7 @@ void BgHakaGate_StatueIdle(BgHakaGate* pthis, GlobalContext* globalCtx)
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
if(pthis->vTimer != 0)
{
@ -254,7 +254,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* pthis, GlobalContext* globalCtx)
turnFinished = Math_StepToS(&pthis->vTurnAngleDeg10, 600, pthis->vTurnRateDeg10);
turnAngle = pthis->vTurnAngleDeg10 * pthis->vTurnDirection;
pthis->dyna.actor.shape.rot.y = (pthis->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f);
if((player->stateFlags2 & PLAYER_STATE2_4) && (sStatueDistToPlayer > 0.0f))
if((player->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING) && (sStatueDistToPlayer > 0.0f))
{
player->actor.world.pos.x = pthis->dyna.actor.home.pos.x + (Math_SinS(pthis->dyna.actor.shape.rot.y - pthis->vInitTurnAngle) * sStatueDistToPlayer);
player->actor.world.pos.z = pthis->dyna.actor.home.pos.z + (Math_CosS(pthis->dyna.actor.shape.rot.y - pthis->vInitTurnAngle) * sStatueDistToPlayer);
@ -266,7 +266,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* pthis, GlobalContext* globalCtx)
sStatueRotY = pthis->dyna.actor.shape.rot.y;
if(turnFinished)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->vRotYDeg10 = (pthis->vRotYDeg10 + turnAngle) % 3600;
pthis->vTurnRateDeg10 = 0;
pthis->vTurnAngleDeg10 = 0;

View File

@ -177,7 +177,7 @@ void func_8088B268(BgHidanRock* pthis, GlobalContext* globalCtx)
if(temp_v1)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
pthis->dyna.actor.home.pos.x = pthis->dyna.actor.world.pos.x;
pthis->dyna.actor.home.pos.z = pthis->dyna.actor.world.pos.z;
@ -190,7 +190,7 @@ void func_8088B268(BgHidanRock* pthis, GlobalContext* globalCtx)
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
if(pthis->timer != 0)
{
@ -212,7 +212,7 @@ void func_8088B268(BgHidanRock* pthis, GlobalContext* globalCtx)
pthis->dyna.actor.world.pos.z = D_8088BF60.z;
pthis->dyna.actor.speedXZ = 0.0f;
D_8088BFC0_42 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->actionFunc = func_8088B79C;
}
@ -365,7 +365,7 @@ void func_8088B990(BgHidanRock* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
pthis->dyna.actor.speedXZ = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
if((pthis->type == 0 && (Math_SmoothStepToF(&pthis->dyna.actor.world.pos.y, pthis->dyna.actor.home.pos.y + 1820.0f, 0.25f, 20.0f, 0.5f) < 0.1f)) ||

View File

@ -152,7 +152,7 @@ void BgIceObjects_Idle(BgIceObjects* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
if((pthis->dyna.unk_150 > 0.0f) && !Player_InCsMode(globalCtx))
{
BgIceObjects_SetNextTarget(pthis, globalCtx);
@ -230,7 +230,7 @@ void BgIceObjects_Reset(BgIceObjects* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
if(Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f))
@ -248,7 +248,7 @@ void BgIceObjects_Stuck(BgIceObjects* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}

View File

@ -63,7 +63,7 @@ void BgJyaBlock_Update(Actor* thisx, GlobalContext* globalCtx)
BgJyaBlock* pthis = (BgJyaBlock*)thisx;
Player* player = GET_PLAYER(globalCtx);
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}

View File

@ -15,9 +15,9 @@ void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx);
void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80896918(BgJyaCobra* pthis, GlobalContext* globalCtx);
void func_80896950(BgJyaCobra* pthis, GlobalContext* globalCtx);
void BgJyaCobra_ActionIdle(BgJyaCobra* pthis, GlobalContext* globalCtx);
void func_808969F8(BgJyaCobra* pthis, GlobalContext* globalCtx);
void func_80896ABC(BgJyaCobra* pthis, GlobalContext* globalCtx);
void BgJyaCobra_ActionRotate(BgJyaCobra* pthis, GlobalContext* globalCtx);
#include "overlays/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra.cpp"
#include "def/code_80043480.h"
@ -462,12 +462,12 @@ void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx)
void func_80896918(BgJyaCobra* pthis, GlobalContext* globalCtx)
{
pthis->actionFunc = func_80896950;
pthis->actionFunc = BgJyaCobra_ActionIdle;
pthis->unk_168 = 0;
pthis->dyna.actor.shape.rot.y = pthis->dyna.actor.world.rot.y = (pthis->unk_16C * 0x2000) + pthis->dyna.actor.home.rot.y;
}
void func_80896950(BgJyaCobra* pthis, GlobalContext* globalCtx)
void BgJyaCobra_ActionIdle(BgJyaCobra* pthis, GlobalContext* globalCtx)
{
Player* player = GET_PLAYER(globalCtx);
@ -487,7 +487,7 @@ void func_80896950(BgJyaCobra* pthis, GlobalContext* globalCtx)
if(fabsf(pthis->dyna.unk_150) > 0.001f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}
@ -497,7 +497,7 @@ void func_808969F8(BgJyaCobra* pthis, GlobalContext* globalCtx)
s32 phi_a3;
s16 temp2;
pthis->actionFunc = func_80896ABC;
pthis->actionFunc = BgJyaCobra_ActionRotate;
temp2 = pthis->dyna.actor.yawTowardsPlayer - pthis->dyna.actor.shape.rot.y;
phi_a3 = (s16)(pthis->dyna.actor.shape.rot.y - pthis->dyna.unk_158);
@ -519,7 +519,7 @@ void func_808969F8(BgJyaCobra* pthis, GlobalContext* globalCtx)
pthis->unk_172 = true;
}
void func_80896ABC(BgJyaCobra* pthis, GlobalContext* globalCtx)
void BgJyaCobra_ActionRotate(BgJyaCobra* pthis, GlobalContext* globalCtx)
{
s16 temp_v0;
Player* player = GET_PLAYER(globalCtx);
@ -537,7 +537,7 @@ void func_80896ABC(BgJyaCobra* pthis, GlobalContext* globalCtx)
if(Math_ScaledStepToS(&pthis->unk_170, pthis->unk_16A * 0x2000, pthis->unk_16E))
{
pthis->unk_16C = (pthis->unk_16C + pthis->unk_16A) & 7;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
func_80896918(pthis, globalCtx);
}
@ -546,7 +546,7 @@ void func_80896ABC(BgJyaCobra* pthis, GlobalContext* globalCtx)
pthis->dyna.actor.shape.rot.y = pthis->dyna.actor.world.rot.y = (pthis->unk_16C * 0x2000) + pthis->dyna.actor.home.rot.y + pthis->unk_170;
}
if(player->stateFlags2 & PLAYER_STATE2_4)
if(player->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING)
{
if(pthis->unk_172)
{

View File

@ -13,7 +13,7 @@ struct BgJyaZurerukabe
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgJyaZurerukabeActionFunc actionFunc;
/* 0x0168 */ s16 unk_168;
/* 0x016A */ s16 unk_16A;
/* 0x016A */ TimerS16 unk_16A;
/* 0x016C */ s16 unk_16C;
/* 0x016E */ s16 unk_16E;
};

View File

@ -129,7 +129,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* pthis, GlobalContext* globalCtx)
if(fabsf(pthis->dyna.unk_150) > 0.001f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}
@ -171,7 +171,7 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* pthis, GlobalContext* globalCtx)
if(fabsf(pthis->dyna.unk_150) > 0.001f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
Math_Vec3f_Copy(&player->actor.world.pos, &pthis->lockedPlayerPos);
}

View File

@ -441,7 +441,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* pthis, GlobalContext* globalCtx)
{
if((gSaveContext.timer1Value == 0) && (sBlocksAtRest == 5))
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
sPuzzleState = 0x10;
sBlocksAtRest = 0;
}
@ -468,13 +468,13 @@ void BgPoEvent_BlockIdle(BgPoEvent* pthis, GlobalContext* globalCtx)
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
DECR(pthis->direction);
}
@ -500,7 +500,7 @@ void BgPoEvent_BlockPush(BgPoEvent* pthis, GlobalContext* globalCtx)
pthis->dyna.actor.world.pos.z = (Math_CosS(pthis->dyna.unk_158) * displacement) + pthis->dyna.actor.home.pos.z;
if(blockStop)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
if((pthis->dyna.unk_150 > 0.0f) && (func_800435D8(globalCtx, &pthis->dyna, 0x1E, 0x32, -0x14) == 0))
{
Audio_PlayActorSound2(&pthis->dyna.actor, NA_SE_EV_BLOCK_BOUND);
@ -529,7 +529,7 @@ void BgPoEvent_BlockReset(BgPoEvent* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
if(Math_StepToF(&pthis->dyna.actor.world.pos.y, 493.0f, 1.0f) && Math_ScaledStepToS(&pthis->dyna.actor.shape.rot.z, pthis->dyna.actor.world.rot.z - 0x4000, 0x400))
@ -551,7 +551,7 @@ void BgPoEvent_BlockSolved(BgPoEvent* pthis, GlobalContext* globalCtx)
if(pthis->dyna.unk_150 != 0.0f)
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
if(Math_StepToF(&pthis->dyna.actor.world.pos.y, 369.0f, 2.0f))
{

View File

@ -271,13 +271,13 @@ void func_808B40AC(BgSpot15Rrbox* pthis, GlobalContext* globalCtx)
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
@ -312,7 +312,7 @@ void func_808B4194(BgSpot15Rrbox* pthis, GlobalContext* globalCtx)
{
actor->home.pos.x = actor->world.pos.x;
actor->home.pos.z = actor->world.pos.z;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
pthis->unk_178 = 0.0f;
pthis->unk_174 = 0.0f;
@ -331,7 +331,7 @@ void func_808B4194(BgSpot15Rrbox* pthis, GlobalContext* globalCtx)
}
actor->home.pos.x = actor->world.pos.x;
actor->home.pos.z = actor->world.pos.z;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
pthis->unk_178 = 0.0f;
pthis->unk_174 = 0.0f;
@ -360,7 +360,7 @@ void func_808B43D0(BgSpot15Rrbox* pthis, GlobalContext* globalCtx)
if(fabsf(pthis->dyna.unk_150) > 0.001f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
Actor_MoveForward(actor);
@ -394,7 +394,7 @@ void func_808B44CC(BgSpot15Rrbox* pthis, GlobalContext* globalCtx)
{
Player* player = GET_PLAYER(globalCtx);
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}

View File

@ -240,7 +240,7 @@ void func_808B8E20(BgSpot18Obj* pthis, GlobalContext* globalCtx)
if(fabsf(pthis->dyna.unk_150) > 0.001f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}
@ -291,7 +291,7 @@ void func_808B8F08(BgSpot18Obj* pthis, GlobalContext* globalCtx)
pthis->dyna.actor.world.pos.x = (Math_SinS(pthis->dyna.actor.world.rot.y) * 80.0f) + pthis->dyna.actor.home.pos.x;
pthis->dyna.actor.world.pos.z = (Math_CosS(pthis->dyna.actor.world.rot.y) * 80.0f) + pthis->dyna.actor.home.pos.z;
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
Flags_SetSwitch(globalCtx, (pthis->dyna.actor.params >> 8) & 0x3F);
Common_PlaySfx(NA_SE_SY_CORRECT_CHIME);
Audio_PlayActorSound2(&pthis->dyna.actor, NA_SE_EV_BLOCK_BOUND);

View File

@ -789,7 +789,7 @@ void EnAm_Statue(EnAm* pthis, GlobalContext* globalCtx)
((pthis->hurtCollider.base.ocFlags1 & OC1_HIT) && (ABS(moveDir) <= 0x2000)))
{
pthis->unk_258 = 0;
player->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_4 | PLAYER_STATE2_REDIRECT_CONTROL | PLAYER_STATE2_8);
player->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_4_JYA_COBRA_TURNING | PLAYER_STATE2_REDIRECT_CONTROL | PLAYER_STATE2_8);
player->actor.speedXZ = 0.0f;
pthis->dyna.unk_150 = pthis->dyna.unk_154 = 0.0f;
}

View File

@ -360,7 +360,7 @@ void EnWallmas_Drop(EnWallmas* pthis, GlobalContext* globalCtx)
{
Player* player = GET_PLAYER(globalCtx);
if(!Player_InCsMode(globalCtx) && !(player->stateFlags2 & PLAYER_STATE2_4) && (player->invincibilityTimer >= 0) && (pthis->actor.xzDistToPlayer < 30.0f) && (pthis->actor.yDistToPlayer < -5.0f) &&
if(!Player_InCsMode(globalCtx) && !(player->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING) && (player->invincibilityTimer >= 0) && (pthis->actor.xzDistToPlayer < 30.0f) && (pthis->actor.yDistToPlayer < -5.0f) &&
(-(f32)(player->cylinder.dim.height + 10) < pthis->actor.yDistToPlayer))
{
EnWallmas_SetupTakePlayer(pthis, globalCtx);

View File

@ -546,13 +546,13 @@ void ObjOshihiki_OnScene(ObjOshihiki* pthis, GlobalContext* globalCtx)
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
@ -598,13 +598,13 @@ void ObjOshihiki_OnActor(ObjOshihiki* pthis, GlobalContext* globalCtx)
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
else
{
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
}
}
@ -665,7 +665,7 @@ void ObjOshihiki_Push(ObjOshihiki* pthis, GlobalContext* globalCtx)
{
thisx->home.pos.x = thisx->world.pos.x;
thisx->home.pos.z = thisx->world.pos.z;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
pthis->pushDist = 0.0f;
pthis->pushSpeed = 0.0f;
@ -681,7 +681,7 @@ void ObjOshihiki_Push(ObjOshihiki* pthis, GlobalContext* globalCtx)
thisx->home.pos.x = thisx->world.pos.x;
thisx->home.pos.z = thisx->world.pos.z;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
pthis->dyna.unk_150 = 0.0f;
pthis->pushDist = 0.0f;
pthis->pushSpeed = 0.0f;
@ -715,7 +715,7 @@ void ObjOshihiki_Fall(ObjOshihiki* pthis, GlobalContext* globalCtx)
if(fabsf(pthis->dyna.unk_150) > 0.001f)
{
pthis->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_4;
player->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
Actor_MoveForward(&pthis->dyna.actor);
if(ObjOshihiki_CheckGround(pthis, globalCtx))

View File

@ -1189,7 +1189,7 @@ void func_80832440(GlobalContext* globalCtx, Player* pthis)
func_8005B1A4(Gameplay_GetCamera(globalCtx, 0));
pthis->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20 | PLAYER_STATE1_21);
pthis->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_CRAWL);
pthis->stateFlags2 &= ~(PLAYER_STATE2_4_JYA_COBRA_TURNING | PLAYER_STATE2_7 | PLAYER_STATE2_CRAWL);
pthis->actor.shape.rot.x = 0;
pthis->actor.shape.yOffset = 0.0f;
@ -7513,7 +7513,7 @@ s32 func_8083F7BC(Player* pthis, GlobalContext* globalCtx)
s32 func_8083F9D0(GlobalContext* globalCtx, Player* pthis)
{
if((pthis->actor.bgCheckFlags & BG_STATE_9) && ((pthis->stateFlags2 & PLAYER_STATE2_4) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)))
if((pthis->actor.bgCheckFlags & BG_STATE_9) && ((pthis->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)))
{
DynaPolyActor* wallPolyActor = NULL;
@ -7524,7 +7524,7 @@ s32 func_8083F9D0(GlobalContext* globalCtx, Player* pthis)
if(&wallPolyActor->actor == pthis->unk_3C4)
{
if(pthis->stateFlags2 & PLAYER_STATE2_4)
if(pthis->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING)
{
return 1;
}
@ -7537,21 +7537,21 @@ s32 func_8083F9D0(GlobalContext* globalCtx, Player* pthis)
Player_ResetActionFunction(pthis, globalCtx);
func_80832264(globalCtx, pthis, &gPlayerAnim_003100);
pthis->stateFlags2 &= ~PLAYER_STATE2_4;
pthis->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
return 1;
}
void func_8083FAB8(Player* pthis, GlobalContext* globalCtx)
{
Player_SetUpdateFunct(globalCtx, pthis, Player_UpdateFunc_8084B898, 0);
pthis->stateFlags2 |= PLAYER_STATE2_4;
pthis->stateFlags2 |= PLAYER_STATE2_4_JYA_COBRA_TURNING;
func_80832264(globalCtx, pthis, &gPlayerAnim_0030F0);
}
void func_8083FB14(Player* pthis, GlobalContext* globalCtx)
{
Player_SetUpdateFunct(globalCtx, pthis, Player_UpdateFunc_8084B9E4, 0);
pthis->stateFlags2 |= PLAYER_STATE2_4;
pthis->stateFlags2 |= PLAYER_STATE2_4_JYA_COBRA_TURNING;
func_80832264(globalCtx, pthis, D_80853C5C[pthis->modelAnimType]);
}
@ -13018,11 +13018,11 @@ void Player_UpdateFunc_8084B898(Player* pthis, GlobalContext* globalCtx)
}
else
{
pthis->stateFlags2 |= PLAYER_STATE2_4;
pthis->stateFlags2 |= PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}
if(pthis->stateFlags2 & PLAYER_STATE2_4)
if(pthis->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING)
{
func_8084B840(globalCtx, pthis, 2.0f);
pthis->linearVelocity = 2.0f;
@ -13087,11 +13087,11 @@ void Player_UpdateFunc_8084B9E4(Player* pthis, GlobalContext* globalCtx)
}
else
{
pthis->stateFlags2 |= PLAYER_STATE2_4;
pthis->stateFlags2 |= PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}
if(pthis->stateFlags2 & PLAYER_STATE2_4)
if(pthis->stateFlags2 & PLAYER_STATE2_4_JYA_COBRA_TURNING)
{
temp2 = func_8083973C(globalCtx, pthis, &D_80854880, &sp5C) - pthis->actor.world.pos.y;
if(fabsf(temp2) < 20.0f)
@ -13105,7 +13105,7 @@ void Player_UpdateFunc_8084B9E4(Player* pthis, GlobalContext* globalCtx)
return;
}
}
pthis->stateFlags2 &= ~PLAYER_STATE2_4;
pthis->stateFlags2 &= ~PLAYER_STATE2_4_JYA_COBRA_TURNING;
}
}