mirror of
https://github.com/izzy2lost/Ghostship.git
synced 2026-06-19 01:17:03 -07:00
Use warp_special(-8)
This commit is contained in:
@@ -14,31 +14,19 @@
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console")) \
|
||||
->SendInfoMessage
|
||||
|
||||
#include "game/level_update.h"
|
||||
#include "game/ingame_menu.h"
|
||||
#include "engine/geo_layout.h"
|
||||
// #include "game/area.h"
|
||||
// #include "game/main.h"
|
||||
extern "C" {
|
||||
void handle_nmi_request(void);
|
||||
void thread5_game_loop(void);
|
||||
void clear_areas(void);
|
||||
extern s8 gResetTimer; // main.h
|
||||
extern s16 gMenuOptSelectIndex; // area.h
|
||||
extern struct Area* gCurrentArea; // area.h
|
||||
extern s16 gMenuMode; // ingame_menu.c
|
||||
extern u32 gGlobalTimer; // game_init.c
|
||||
void warp_special(int32_t arg);
|
||||
extern int16_t sCurrPlayMode; // level_update.h
|
||||
}
|
||||
|
||||
static bool ResetHandler(std::shared_ptr<Ship::Console> Console, std::vector<std::string> args, std::string* output) {
|
||||
// FIXME: Consistently seems to crash at alloc_only_pool_alloc after 4 times of loading into a level and resetting
|
||||
handle_nmi_request();
|
||||
gResetTimer = 0;
|
||||
clear_areas();
|
||||
gHudDisplay.flags = HUD_DISPLAY_NONE;
|
||||
gMenuMode = MENU_MODE_NONE;
|
||||
thread5_game_loop();
|
||||
return 0;
|
||||
// Do not reset unless currently playing a level
|
||||
if (sCurrPlayMode == 0) { // PLAY_MODE_NORMAL
|
||||
warp_special(-8);
|
||||
return 0;
|
||||
}
|
||||
*output = "Cannot reset: sCurrPlayMode must be 0 but is " + std::to_string(sCurrPlayMode);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void DevConsole_Init(void) {
|
||||
|
||||
Reference in New Issue
Block a user