mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 03:55:11 +00:00
Add a 1 second window to prevent a warp from instantly warping you back (a workaround for broken romhack ports)
This commit is contained in:
parent
22761949f7
commit
48d517ab0d
3 changed files with 13 additions and 0 deletions
|
@ -420,6 +420,7 @@ struct MarioState
|
||||||
/*????*/ u8 visibleToEnemies;
|
/*????*/ u8 visibleToEnemies;
|
||||||
/*????*/ u32 cap;
|
/*????*/ u32 cap;
|
||||||
/*????*/ u8 bounceSquishTimer;
|
/*????*/ u8 bounceSquishTimer;
|
||||||
|
/*????*/ u8 skipWarpInteractionsTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TextureInfo
|
struct TextureInfo
|
||||||
|
|
|
@ -1043,6 +1043,10 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
||||||
if (!m || !o) { return FALSE; }
|
if (!m || !o) { return FALSE; }
|
||||||
u32 action;
|
u32 action;
|
||||||
|
|
||||||
|
if (m->skipWarpInteractionsTimer > 0) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (m != &gMarioStates[0]) {
|
if (m != &gMarioStates[0]) {
|
||||||
// don't do for remote players
|
// don't do for remote players
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -2295,6 +2299,10 @@ void mario_process_interactions(struct MarioState *m) {
|
||||||
sDelayInvincTimer = FALSE;
|
sDelayInvincTimer = FALSE;
|
||||||
gInteractionInvulnerable = (m->action & ACT_FLAG_INVULNERABLE) || m->invincTimer != 0;
|
gInteractionInvulnerable = (m->action & ACT_FLAG_INVULNERABLE) || m->invincTimer != 0;
|
||||||
|
|
||||||
|
if (m->skipWarpInteractionsTimer) {
|
||||||
|
m->skipWarpInteractionsTimer--;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(m->action & ACT_FLAG_INTANGIBLE) && m->collidedObjInteractTypes != 0 && is_player_active(m)) {
|
if (!(m->action & ACT_FLAG_INTANGIBLE) && m->collidedObjInteractTypes != 0 && is_player_active(m)) {
|
||||||
s32 i;
|
s32 i;
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
|
|
|
@ -536,6 +536,10 @@ void init_mario_after_warp(void) {
|
||||||
gMarioState->health = 0x880;
|
gMarioState->health = 0x880;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gMarioState) {
|
||||||
|
gMarioState->skipWarpInteractionsTimer = 30;
|
||||||
|
}
|
||||||
|
|
||||||
smlua_call_event_hooks(HOOK_ON_WARP);
|
smlua_call_event_hooks(HOOK_ON_WARP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue