mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
put timer condition as should when convenient
This commit is contained in:
parent
e2671e7f2b
commit
b53b742fd9
6 changed files with 16 additions and 29 deletions
|
@ -1994,7 +1994,7 @@ typedef enum {
|
|||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// varies, never set should to true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*Actor`
|
||||
|
|
|
@ -166,10 +166,8 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
|
|
|
@ -91,10 +91,9 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) {
|
|||
|
||||
if (!Flags_GetSwitch(play, this->actor.params)) {
|
||||
if (this->framesUntilDisable != -1) {
|
||||
if (this->framesUntilDisable != 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->framesUntilDisable)) {
|
||||
this->framesUntilDisable -= 1;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->framesUntilDisable != 0, this,
|
||||
&this->framesUntilDisable)) {
|
||||
this->framesUntilDisable -= 1;
|
||||
}
|
||||
if (this->framesUntilDisable == 0) {
|
||||
this->framesUntilDisable = -1;
|
||||
|
|
|
@ -134,10 +134,8 @@ void func_808A90F4(BgRelayObjects* this, PlayState* play) {
|
|||
|
||||
void func_808A91AC(BgRelayObjects* this, PlayState* play) {
|
||||
if (this->unk_169 != 5) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
func_8002F994(&this->dyna.actor, this->timer);
|
||||
}
|
||||
|
@ -171,10 +169,8 @@ void BgRelayObjects_DoNothing(BgRelayObjects* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808A932C(BgRelayObjects* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
if (this->timer == 0) {
|
||||
if (!Player_InCsMode(play)) {
|
||||
|
|
|
@ -127,10 +127,8 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
func_8002F994(&this->dyna.actor, this->timer);
|
||||
|
@ -149,10 +147,8 @@ void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->timer != 0, this, &this->timer)) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
|
|
|
@ -240,10 +240,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
|
|||
Collider_UpdateCylinder(&this->actor, &this->colliderFlame);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderFlame.base);
|
||||
|
||||
if (this->litTimer > 0) {
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->litTimer)) {
|
||||
this->litTimer--;
|
||||
}
|
||||
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, this->litTimer > 0, this, &this->litTimer)) {
|
||||
this->litTimer--;
|
||||
if ((this->litTimer == 0) && (torchType != 0)) {
|
||||
sLitTorchCount--;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue