Add EVENT_PREGAME. Now all sprites are processed in the following fashion:

1. EVENT_PREGAME
2. hardcoded stuff
3. EVENT_GAME

One potential use is to examine values which are clobbered by commands such as ifhitweapon/ifwasweapon.

git-svn-id: https://svn.eduke32.com/eduke32@2973 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-08-27 03:49:55 +00:00
parent 6650f34105
commit 2620738eb9
4 changed files with 31 additions and 1 deletions

View file

@ -8061,6 +8061,33 @@ int32_t A_CheckSwitchTile(int32_t i)
void G_MoveWorld(void)
{
{
int32_t j, k = MAXSTATUS-1, pl;
do
{
int32_t i = headspritestat[k];
while (i >= 0)
{
if (!apScriptGameEvent[EVENT_PREGAME] || A_CheckSpriteFlags(i, SPRITE_NOEVENTCODE))
{
i = nextspritestat[i];
continue;
}
j = nextspritestat[i];
{
int32_t p;
pl = A_FindPlayer(&sprite[i], &p);
VM_OnEvent(EVENT_PREGAME,i, pl, p, 0);
}
i = j;
}
}
while (k--);
}
G_MoveZombieActors(); //ST 2
G_MoveWeapons(); //ST 4
G_MoveTransports(); //ST 9

View file

@ -666,7 +666,8 @@ const tokenlist EventNames[MAXEVENTS] =
{ "EVENT_CHECKTOUCHDAMAGE", EVENT_CHECKTOUCHDAMAGE },
{ "EVENT_CHECKFLOORDAMAGE", EVENT_CHECKFLOORDAMAGE },
{ "EVENT_LOADGAME", EVENT_LOADGAME },
{ "EVENT_SAVEGAME", EVENT_SAVEGAME }
{ "EVENT_SAVEGAME", EVENT_SAVEGAME },
{ "EVENT_PREGAME", EVENT_PREGAME }
};
const memberlabel_t SectorLabels[]=

View file

@ -123,6 +123,7 @@ enum GameEvent_t {
EVENT_CHECKFLOORDAMAGE, // 90
EVENT_LOADGAME,
EVENT_SAVEGAME,
EVENT_PREGAME,
MAXEVENTS
};

View file

@ -158,6 +158,7 @@ labels =
EVENT_CHECKFLOORDAMAGE = 90,
EVENT_LOADGAME = 91,
EVENT_SAVEGAME = 92,
EVENT_PREGAME = 93,
},
}