mirror of https://github.com/sm64pc/sm64pc.git
God mode & warp menu fix
This commit is contained in:
parent
7d06ec5758
commit
93c0487f53
|
@ -57,6 +57,8 @@ static struct LevelCommand *sCurrentCmd;
|
|||
|
||||
static struct MemoryPool *sMemPoolForGoddard;
|
||||
|
||||
bool mario_loaded = false;
|
||||
|
||||
static s32 eval_script_op(s8 op, s32 arg) {
|
||||
s32 result = 0;
|
||||
|
||||
|
@ -421,6 +423,8 @@ static void level_cmd_init_mario(void) {
|
|||
gMarioSpawnInfo->unk18 = get_graph_node(model);
|
||||
gMarioSpawnInfo->next = NULL;
|
||||
|
||||
mario_loaded = true;
|
||||
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define LEVEL_SCRIPT_H
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct LevelCommand;
|
||||
|
||||
|
@ -9,4 +10,6 @@ extern u8 level_script_entry[];
|
|||
|
||||
struct LevelCommand *level_script_execute(struct LevelCommand *cmd);
|
||||
|
||||
extern bool mario_loaded;
|
||||
|
||||
#endif // LEVEL_SCRIPT_H
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "thread6.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/cheats.h"
|
||||
#include "moon/saturn/saturn_types.h"
|
||||
#ifdef BETTERCAMERA
|
||||
#include "bettercamera.h"
|
||||
#endif
|
||||
|
@ -1544,6 +1545,9 @@ void update_mario_health(struct MarioState *m) {
|
|||
gRumblePakTimer = 0;
|
||||
}
|
||||
}
|
||||
if (enable_god) {
|
||||
m->health = 0x880;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -71,6 +71,7 @@ extern "C" {
|
|||
#include "game/camera.h"
|
||||
#include "game/mario.h"
|
||||
#include "game/level_update.h"
|
||||
#include "engine/level_script.h"
|
||||
#include "level_table.h"
|
||||
}
|
||||
|
||||
|
@ -101,10 +102,11 @@ static void HelpMarker(const char* desc)
|
|||
}
|
||||
|
||||
void warp_to(s16 destLevel, s16 destArea = 0x01, s16 destWarpNode = 0x0A) {
|
||||
if (gCurrLevelNum == destLevel) {
|
||||
if (gCurrLevelNum == destLevel || !mario_loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
mario_loaded = false;
|
||||
initiate_warp(destLevel, destArea, destWarpNode, 0);
|
||||
fade_into_special_warp(0,0);
|
||||
}
|
||||
|
@ -464,6 +466,10 @@ namespace MoonInternal {
|
|||
|
||||
ImGui::Dummy(ImVec2(0, 5));
|
||||
|
||||
ImGui::Checkbox("God Mode", &enable_god);
|
||||
|
||||
ImGui::Dummy(ImVec2(0, 5));
|
||||
|
||||
const char* levelList[] = {
|
||||
"Castle Grounds", "Castle Inside", "Bob-omb Battlefield",
|
||||
"Whomp's Fortress", "Princess's Secret Slide", "Tower of the Wing Cap",
|
||||
|
|
|
@ -31,6 +31,7 @@ extern "C" {
|
|||
bool camera_frozen;
|
||||
bool enable_head_rotations;
|
||||
bool enable_shadows;
|
||||
bool enable_god;
|
||||
bool enable_dust_particles;
|
||||
|
||||
bool show_menu_bar;
|
||||
|
@ -66,6 +67,7 @@ namespace MoonInternal {
|
|||
|
||||
camera_frozen = false;
|
||||
enable_shadows = true;
|
||||
enable_god = false;
|
||||
enable_yoshi = false;
|
||||
|
||||
MoonInternal::load_cc_directory();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
extern bool enable_head_rotations;
|
||||
extern bool enable_shadows;
|
||||
extern bool enable_god;
|
||||
extern bool enable_dust_particles;
|
||||
|
||||
// Color Codes
|
||||
|
|
Loading…
Reference in New Issue