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_SOUND", EVENT_SOUND },
{ "EVENT_CHECKTOUCHDAMAGE", EVENT_CHECKTOUCHDAMAGE },
{ "EVENT_CHECKFLOORDAMAGE", EVENT_CHECKFLOORDAMAGE }
{ "EVENT_CHECKFLOORDAMAGE", EVENT_CHECKFLOORDAMAGE },
{ "EVENT_LOADGAME", EVENT_LOADGAME },
{ "EVENT_SAVEGAME", EVENT_SAVEGAME }
};
const memberlabel_t SectorLabels[]=

View File

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

View File

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

View File

@ -1563,7 +1563,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
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)

View File

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