Add EVENT_LOADGAME and EVENT_SAVEGAME, self-explanatory. Also make EVENT_NEWGAME use myconnectindex for player ID instead of screenpeek.

git-svn-id: https://svn.eduke32.com/eduke32@2688 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-05-25 05:14:19 +00:00
parent af511ed275
commit 7f920c5541
5 changed files with 12 additions and 2 deletions

View file

@ -663,7 +663,9 @@ const tokenlist EventNames[MAXEVENTS] =
{ "EVENT_NEWGAME", EVENT_NEWGAME }, { "EVENT_NEWGAME", EVENT_NEWGAME },
{ "EVENT_SOUND", EVENT_SOUND }, { "EVENT_SOUND", EVENT_SOUND },
{ "EVENT_CHECKTOUCHDAMAGE", EVENT_CHECKTOUCHDAMAGE }, { "EVENT_CHECKTOUCHDAMAGE", EVENT_CHECKTOUCHDAMAGE },
{ "EVENT_CHECKFLOORDAMAGE", EVENT_CHECKFLOORDAMAGE } { "EVENT_CHECKFLOORDAMAGE", EVENT_CHECKFLOORDAMAGE },
{ "EVENT_LOADGAME", EVENT_LOADGAME },
{ "EVENT_SAVEGAME", EVENT_SAVEGAME }
}; };
const memberlabel_t SectorLabels[]= const memberlabel_t SectorLabels[]=

View file

@ -121,6 +121,8 @@ enum GameEvent_t {
EVENT_SOUND, EVENT_SOUND,
EVENT_CHECKTOUCHDAMAGE, EVENT_CHECKTOUCHDAMAGE,
EVENT_CHECKFLOORDAMAGE, EVENT_CHECKFLOORDAMAGE,
EVENT_LOADGAME,
EVENT_SAVEGAME,
MAXEVENTS MAXEVENTS
}; };

View file

@ -364,6 +364,8 @@ enum GameEvent_t {
EVENT_SOUND, EVENT_SOUND,
EVENT_CHECKTOUCHDAMAGE, EVENT_CHECKTOUCHDAMAGE,
EVENT_CHECKFLOORDAMAGE, EVENT_CHECKFLOORDAMAGE,
EVENT_LOADGAME,
EVENT_SAVEGAME,
MAXEVENTS MAXEVENTS
}; };
]] ]]

View file

@ -1563,7 +1563,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
display_mirror = 0; display_mirror = 0;
VM_OnEvent(EVENT_NEWGAME, g_player[screenpeek].ps->i, screenpeek, -1, 0); VM_OnEvent(EVENT_NEWGAME, g_player[myconnectindex].ps->i, myconnectindex, -1, 0);
} }
static void resetpspritevars(char g) static void resetpspritevars(char g)

View file

@ -299,6 +299,8 @@ int32_t G_LoadPlayer(int32_t spot)
sv_postudload(); // ud.m_XXX = ud.XXX sv_postudload(); // ud.m_XXX = ud.XXX
VM_OnEvent(EVENT_LOADGAME, g_player[myconnectindex].ps->i, myconnectindex, -1, 0);
return 0; return 0;
} }
@ -342,6 +344,8 @@ int32_t G_SavePlayer(int32_t spot)
polymer_resetlights(); polymer_resetlights();
#endif #endif
VM_OnEvent(EVENT_SAVEGAME, g_player[myconnectindex].ps->i, myconnectindex, -1, 0);
// SAVE! // SAVE!
sv_saveandmakesnapshot(fil, spot, 0, 0, 0); sv_saveandmakesnapshot(fil, spot, 0, 0, 0);