swapping pcs so ill just commit this~

This commit is contained in:
ElijahZAwesome 2018-02-11 15:32:32 -06:00
parent 4f0e3c4dd4
commit 5423be67ca
3 changed files with 16 additions and 1 deletions

View file

@ -89,6 +89,8 @@
//WARNING: Having this set to different values in different clients will break multiplayer!
#define TESTGODMODE false
bool paused;
u32 localUID;
int loadedtp;

View file

@ -368,7 +368,6 @@ void renderGame() {
}
void exitGame() {
romfsExit();
networkDisconnect();
synchronizerReset();

View file

@ -25,6 +25,8 @@
//TODO: Something still causes desyncs very rarely
static aptHookCookie cookie;
void setupGame() {
synchronizerInit(rand(), 1, 0);
synchronizerSetPlayerUID(0, localUID);
@ -77,6 +79,16 @@ void setupBGMap() {
initBGMap = 0;
}
static void task_apt_hook(APT_HookType hook, void* param) {
switch(hook) {
case APTHOOK_ONSUSPEND:
paused = true;
stopMusic();
break;
default:
break;
}
}
//for rendering -> move to a better place
@ -188,7 +200,9 @@ int main() {
initPlayers();
initRecipes();
initTrades();
aptHook(&cookie, task_apt_hook, NULL);
while (aptMainLoop()) {
if (paused == true) playMusic(&music_menu);
if (quitGame) break;
if (initGame > 0 && --initGame==0) setupGame();