Skip to content

Commit

Permalink
Changing speed alone does change fast speed
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Apr 28, 2021
1 parent 160f420 commit ad8304b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions prboom2/src/dsda/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void dsda_InitDoom(void) {
mobjinfo[i].projectile_group = PG_DEFAULT;
mobjinfo[i].splash_group = SG_DEFAULT;
mobjinfo[i].ripsound = sfx_None;
mobjinfo[i].altspeed = mobjinfo[i].speed;
mobjinfo[i].altspeed = NO_ALTSPEED;
}

// don't want to reorganize info.c structure for a few tweaks...
Expand Down Expand Up @@ -399,7 +399,7 @@ static void dsda_InitHeretic(void) {
mobjinfo[j].projectile_group = PG_DEFAULT;
mobjinfo[j].splash_group = SG_DEFAULT;
mobjinfo[j].ripsound = heretic_sfx_None;
mobjinfo[j].altspeed = mobjinfo[j].speed;
mobjinfo[j].altspeed = NO_ALTSPEED;
}

// don't want to reorganize info.c structure for a few tweaks...
Expand Down
11 changes: 6 additions & 5 deletions prboom2/src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -2821,11 +2821,12 @@ void G_SetFastParms(int fast_pending)

if (fast != fast_pending) { /* only change if necessary */
for (i = 0; i < num_mobj_types; ++i)
{
int swap = mobjinfo[i].speed;
mobjinfo[i].speed = mobjinfo[i].altspeed;
mobjinfo[i].altspeed = swap;
}
if (mobjinfo[i].altspeed != NO_ALTSPEED)
{
int swap = mobjinfo[i].speed;
mobjinfo[i].speed = mobjinfo[i].altspeed;
mobjinfo[i].altspeed = swap;
}

if ((fast = fast_pending))
{
Expand Down
2 changes: 2 additions & 0 deletions prboom2/src/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -3089,6 +3089,8 @@ typedef struct
int altspeed;
} mobjinfo_t;

#define NO_ALTSPEED -1

typedef struct
{
int doomednum;
Expand Down

0 comments on commit ad8304b

Please sign in to comment.