int GotoGameCommon(int mode) { StopTime(); //@@ init_player_stats(); //@@ //@@ gameData.multi.playerInit.pos = Player->pos; //@@ gameData.multi.playerInit.orient = Player->orient; //@@ gameData.multi.playerInit.segnum = Player->segnum; // -- must always save gamesave.sav because the restore-gameData.objs.objects code relies on it // -- that code could be made smarter and use the original file, if appropriate. // if (mine_changed) if (gamestate_not_restored == 0) { gamestate_not_restored = 1; save_level("GAMESAVE.LVL"); editor_status("Gamestate saved.\n"); } ai_reset_all_paths(); StartTime(); ModeFlag = mode; return 1; }
int GotoGameScreen() { stop_time(); //@@ init_player_stats(); //@@ //@@ Player_init.pos = Player->pos; //@@ Player_init.orient = Player->orient; //@@ Player_init.segnum = Player->segnum; // -- must always save gamesave.sav because the restore-objects code relies on it // -- that code could be made smarter and use the original file, if appropriate. // if (mine_changed) if (gamestate_not_restored == 0) { gamestate_not_restored = 1; save_level("GAMESAVE.LVL"); editor_status("Gamestate saved.\n"); } ai_reset_all_paths(); start_time(); ModeFlag = 3; return 1; }
// ----------------------------------------------------------------------------------------------------- //called when the player is starting a level (new game or new ship) StartLevel(int random) { Assert(!Player_is_dead); InitPlayerPosition(random); verify_console_object(); ConsoleObject->control_type = CT_FLYING; ConsoleObject->movement_type = MT_PHYSICS; disable_matcens(); clear_transient_objects(0); //0 means leave proximity bombs // create_player_appearance_effect(ConsoleObject); Do_appearance_effect = 1; #ifdef NETWORK if (Game_mode & GM_MULTI) { #ifndef SHAREWARE if (Game_mode & GM_MULTI_COOP) multi_send_score(); #endif multi_send_position(Players[Player_num].objnum); multi_send_reappear(); } if (Game_mode & GM_NETWORK) network_do_frame(1, 1); #endif ai_reset_all_paths(); ai_init_boss_for_ship(); reset_time(); reset_rear_view(); Auto_fire_fusion_cannon_time = 0; Fusion_charge = 0; Robot_firing_enabled = 1; if (VR_screen_mode == SCREEN_MENU) vr_reset_display(); }
// ----------------------------------------------------------------------------------------------------- //called when the player is starting a level (new game or new ship) void StartLevel(int random) { Assert(!Player_is_dead); InitPlayerPosition(random); verify_console_object(); ConsoleObject->control_type = CT_FLYING; ConsoleObject->movement_type = MT_PHYSICS; // create_player_appearance_effect(ConsoleObject); Do_appearance_effect = 1; if (Game_mode & GM_MULTI) { if (Game_mode & GM_MULTI_COOP) multi_send_score(); multi_send_reappear(); multi_do_protocol_frame(1, 1); } else // in Singleplayer, after we died ... { disable_matcens(); // ... disable matcens and ... clear_transient_objects(0); // ... clear all transient objects. } ai_reset_all_paths(); ai_init_boss_for_ship(); reset_rear_view(); Auto_fire_fusion_cannon_time = 0; Fusion_charge = 0; if (!(Game_mode & GM_MULTI)) // stuff for Singleplayer only { } }