IMPLEMENT_FUNCTION(VLevelInfo, AutoSave) { P_GET_SELF; if (Self->Game->NetMode == NM_Standalone) { SV_SaveGame(SV_GetRebornSlot(), REBORN_DESCRIPTION); } }
/* ============== SV_AutoSave_f ============== */ void SV_AutoSave_f( void ) { if( Cmd_Argc() != 1 ) { Msg( "Usage: autosave\n" ); return; } SV_SaveGame( "autosave" ); }
/* ============== SV_Save_f ============== */ void SV_Save_f( void ) { const char *name; switch( Cmd_Argc() ) { case 1: name = "new"; break; case 2: name = Cmd_Argv( 1 ); break; default: Msg( "Usage: save <savename>\n" ); return; } SV_SaveGame( name ); }
/* ============== SV_Save_f ============== */ void SV_Save_f( void ) { const char *name; switch( Cmd_Argc() ) { case 1: name = "new"; break; case 2: name = Cmd_Argv( 1 ); break; default: Msg( "Usage: save <savename>\n" ); return; } if( host_xashds_hacks->value ) { Cbuf_InsertText(va("rcon save %s\n", Cmd_Argv( 1 ))); return; } SV_SaveGame( name ); }
void VBasePlayer::SpawnClient() { guard(VBasePlayer::SpawnClient); if (!sv_loading) { if (PlayerFlags & PF_Spawned) { GCon->Log(NAME_Dev, "Already spawned"); } if (MO) { GCon->Log(NAME_Dev, "Mobj already spawned"); } eventSpawnClient(); for (int i = 0; i < Level->XLevel->ActiveSequences.Num(); i++) { eventClientStartSequence( Level->XLevel->ActiveSequences[i].Origin, Level->XLevel->ActiveSequences[i].OriginId, Level->XLevel->ActiveSequences[i].Name, Level->XLevel->ActiveSequences[i].ModeNum); for (int j = 0; j < Level->XLevel->ActiveSequences[i].Choices.Num(); j++) { eventClientAddSequenceChoice( Level->XLevel->ActiveSequences[i].OriginId, Level->XLevel->ActiveSequences[i].Choices[j]); } } } else { if (!MO) { Host_Error("Player without Mobj\n"); } } ViewAngles.roll = 0; eventClientSetAngles(ViewAngles); PlayerFlags &= ~PF_FixAngle; PlayerFlags |= PF_Spawned; if ((GGameInfo->NetMode == NM_TitleMap || GGameInfo->NetMode == NM_Standalone) && run_open_scripts) { // Start open scripts. Level->XLevel->Acs->StartTypedACScripts(SCRIPT_Open, 0, 0, 0, NULL, false, false); } if (!sv_loading) { Level->XLevel->Acs->StartTypedACScripts(SCRIPT_Enter, 0, 0, 0, MO, true, false); } else if (sv_map_travel) { Level->XLevel->Acs->StartTypedACScripts(SCRIPT_Return, 0, 0, 0, MO, true, false); } if (GGameInfo->NetMode < NM_DedicatedServer || svs.num_connected == sv_load_num_players) { sv_loading = false; sv_map_travel = false; } // For single play, save immediately into the reborn slot if (GGameInfo->NetMode < NM_DedicatedServer) { SV_SaveGame(SV_GetRebornSlot(), REBORN_DESCRIPTION); } unguard; }
/* ============== SV_AutoSave_f ============== */ void SV_AutoSave_f( void ) { SV_SaveGame( "autosave" ); }
int main(void) { char cond = '*'; LIS_tppCabeca * completas; LIS_tppCabeca * Princ; Princ = LIS_CriaLista(DestruirValor); inicializa_estrutura(Princ); LIS_IrInicioLista(Princ); LIS_AvancarElementoCorrente(Princ, 1); completas = (LIS_tppCabeca *)LIS_ObterValor(Princ); do { system("cls"); printf("Aperte N - para comecar um novo jogo!\n"); printf("Aperte C - para continuar um jogo salvo!\n"); printf("Escolha: "); scanf(" %c", &cond); if (cond == 'N' || cond == 'n') { criar_novo_jogo(Princ); } else if (cond == 'C' || cond == 'c') { SV_LoadGame(Princ); } else { printf("Opcao invalida!"); Sleep(2500); } } while (cond != 'N' && cond != 'n' && cond != 'C' && cond != 'c'); system("cls"); imprime(Princ); printf("Digite P - para pedir cartas do monte\n"); printf("Digite M - para mover cartas\n"); printf("Digite S - para Sair e salvar o jogo corrente\n"); printf("Escolha: "); scanf(" %c", &cond); while (cond != 'S' && cond != 's') { if (cond == 'P' || cond == 'p') { pedir_monte(Princ, completas); if (LIS_AcessaNumElem(completas) == 104) { cond = 'E'; break; } } else if (cond == 'M' || cond == 'm') { move_cartas_sequencias(Princ, completas); if (LIS_AcessaNumElem(completas) == 104) { cond = 'E'; break; } } system("cls"); imprime(Princ); printf("Digite P - para pedir cartas do monte\n"); printf("Digite M - para mover cartas\n"); printf("Digite S - para Sair e salvar o jogo corrente\n"); printf("Escolha: "); scanf(" %c", &cond); } if (cond == 'S' || cond == 's') { SV_SaveGame(Princ); } else if (cond == 'E') { system("cls"); printf("Parabens, voce terminou o jogo!\n\n\n\t\tYou are a champion!\n"); } LIS_DestroiLista(Princ); return 0; }/* Fim Função: Main*/