mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
Factor out code for launching EVENT_GAME and EVENT_PREGAME.
git-svn-id: https://svn.eduke32.com/eduke32@6081 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
06a38e3873
commit
af66b8a99f
1 changed files with 14 additions and 36 deletions
|
@ -8249,13 +8249,9 @@ void G_RefreshLights(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void G_MoveWorld(void)
|
||||
static void G_DoEventGame(int nEventID)
|
||||
{
|
||||
extern double g_moveActorsTime;
|
||||
|
||||
VM_OnEvent(EVENT_PREWORLD, -1, -1);
|
||||
|
||||
if (VM_HaveEvent(EVENT_PREGAME))
|
||||
if (VM_HaveEvent(nEventID))
|
||||
{
|
||||
int statNum = 0;
|
||||
|
||||
|
@ -8275,13 +8271,22 @@ void G_MoveWorld(void)
|
|||
|
||||
int32_t playerDist;
|
||||
int const playerNum = A_FindPlayer(&sprite[spriteNum], &playerDist);
|
||||
VM_OnEventWithDist_(EVENT_PREGAME, spriteNum, playerNum, playerDist);
|
||||
VM_OnEventWithDist_(nEventID, spriteNum, playerNum, playerDist);
|
||||
|
||||
spriteNum = nextSprite;
|
||||
}
|
||||
}
|
||||
while (statNum < MAXSTATUS);
|
||||
}
|
||||
}
|
||||
|
||||
void G_MoveWorld(void)
|
||||
{
|
||||
extern double g_moveActorsTime;
|
||||
|
||||
VM_OnEvent(EVENT_PREWORLD, -1, -1);
|
||||
|
||||
G_DoEventGame(EVENT_PREGAME);
|
||||
|
||||
G_MoveZombieActors(); //ST 2
|
||||
G_MoveWeapons(); //ST 4
|
||||
|
@ -8306,34 +8311,7 @@ void G_MoveWorld(void)
|
|||
|
||||
VM_OnEvent(EVENT_WORLD, -1, -1);
|
||||
|
||||
if (VM_HaveEvent(EVENT_GAME))
|
||||
{
|
||||
int statNum = 0;
|
||||
|
||||
do
|
||||
{
|
||||
int spriteNum = headspritestat[statNum++];
|
||||
|
||||
while (spriteNum >= 0)
|
||||
{
|
||||
|
||||
if (A_CheckSpriteFlags(spriteNum, SFLAG_NOEVENTCODE))
|
||||
{
|
||||
spriteNum = nextspritestat[spriteNum];
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t playerDist;
|
||||
int const nextSprite = nextspritestat[spriteNum];
|
||||
int const playerNum = A_FindPlayer(&sprite[spriteNum], &playerDist);
|
||||
|
||||
VM_OnEventWithDist_(EVENT_GAME, spriteNum, playerNum, playerDist);
|
||||
|
||||
spriteNum = nextSprite;
|
||||
}
|
||||
}
|
||||
while (statNum < MAXSTATUS);
|
||||
}
|
||||
G_DoEventGame(EVENT_GAME);
|
||||
|
||||
G_RefreshLights();
|
||||
G_DoSectorAnimations();
|
||||
|
|
Loading…
Reference in a new issue