Skip to content

Commit

Permalink
Fix Respawn Cooldown being there when it shouldn't, rewrote in C
Browse files Browse the repository at this point in the history
  • Loading branch information
lilousky committed Nov 20, 2024
1 parent a5e0322 commit 385e72d
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 49 deletions.
Binary file modified files/UIPatches/Global/message/Manu.bmg
Binary file not shown.
14 changes: 14 additions & 0 deletions src/include/kartdynamics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
#include "common.h"

typedef struct {
u8 unk[0x171]; // Values we don't need to know
bool noGravity;
bool isHit;
bool force0xVelY;
bool inBullet;
// Incomplete (more values we don't need to know)
} KartDynamics;



3 changes: 0 additions & 3 deletions src/payload/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ void loadCodes() {
// Instant Respawn + Respawn Cooldown (by davidevgen, CLF78,stebler and Lami)
directWrite8(InstantRespawn1, 0);
directWriteBranch(InstantRespawn2, RespawnCooldown, true);
directWrite8(InstantRespawn3, 0);
directWrite8(InstantRespawn4, 0);
directWrite8Offset(InstantRespawn4, 0x2, 0);

// Invisibility (by CLF78)
directWriteBranch(InvisibilityHook, Invisibility, true);
Expand Down
34 changes: 0 additions & 34 deletions src/payload/main/respawn.S

This file was deleted.

17 changes: 17 additions & 0 deletions src/payload/main/respawn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "common.h"
#include "hidenseek.h"
#include "kartdynamics.h"
#include "os.h"
#include "racedata.h"

extern u8 InstantRespawn3;
void RespawnCooldown(KartDynamics* kartDynamics){
if (Have30SecondsPassed && !HideNSeekData.players[Racedata->main.scenarios[0].settings.hudPlayerIds[0]].isSeeker){
kartDynamics->noGravity = 1;
InstantRespawn3 = 0x6E;
} else {
kartDynamics->noGravity = 0;
InstantRespawn3 = 0;
}
}

5 changes: 2 additions & 3 deletions src/rmce.ld
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ SECTIONS {

/* Instant Respawn */
InstantRespawn1 = 0x8056EFDB;
InstantRespawn2 = 0x805733BC;
InstantRespawn3 = 0x8057339b;
InstantRespawn4 = 0x808b1305;
InstantRespawn2 = 0x8057339c;
InstantRespawn3 = 0x808b1305;

/* Invisibility */
InvisibilityHook = 0x80653AAC;
Expand Down
5 changes: 2 additions & 3 deletions src/rmcj.ld
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ SECTIONS {

/* Instant Respawn */
InstantRespawn1 = 0x805737AB;
InstantRespawn2 = 0x805795A0;
InstantRespawn3 = 0x8057957f;
InstantRespawn4 = 0x808b4d25;
InstantRespawn2 = 0x80579580;
InstantRespawn3 = 0x808b4d25;

/* Invisibility */
InvisibilityHook = 0x806575A0;
Expand Down
5 changes: 2 additions & 3 deletions src/rmck.ld
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ SECTIONS {

/* Instant Respawn */
InstantRespawn1 = 0x80561E83;
InstantRespawn2 = 0x80567C78;
InstantRespawn3 = 0x80567c57;
InstantRespawn4 = 0x808a403d;
InstantRespawn2 = 0x80567c58;
InstantRespawn3 = 0x808a403d;

/* Invisibility */
InvisibilityHook = 0x8064624C;
Expand Down
5 changes: 2 additions & 3 deletions src/rmcp.ld
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ SECTIONS {

/* Instant Respawn */
InstantRespawn1 = 0x80573E2B;
InstantRespawn2 = 0x80579C20;
InstantRespawn3 = 0x80579bff;
InstantRespawn4 = 0x808b5bc5;
InstantRespawn2 = 0x80579c00;
InstantRespawn3 = 0x808b5bc5;

/* Invisibility */
InvisibilityHook = 0x80657F34;
Expand Down

0 comments on commit 385e72d

Please sign in to comment.