Skip to content

Commit

Permalink
Merge branch 'next' into public_next
Browse files Browse the repository at this point in the history
  • Loading branch information
ninesphere committed May 4, 2023
2 parents 3135cd3 + 62deaaa commit f114761
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 15 deletions.
13 changes: 7 additions & 6 deletions src/f_finale.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static tic_t introscenetime[NUMINTROSCENES] =
};

// custom intros
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS);

void F_StartIntro(void)
{
Expand All @@ -349,7 +349,7 @@ void F_StartIntro(void)
if (!cutscenes[introtoplay - 1])
D_StartTitle();
else
F_StartCustomCutscene(introtoplay - 1, false, false);
F_StartCustomCutscene(introtoplay - 1, false, false, false);
return;
}

Expand Down Expand Up @@ -1257,7 +1257,7 @@ void F_StartCredits(void)

if (creditscutscene)
{
F_StartCustomCutscene(creditscutscene - 1, false, false);
F_StartCustomCutscene(creditscutscene - 1, false, false, false);
return;
}

Expand Down Expand Up @@ -3859,7 +3859,7 @@ static INT32 scenenum, cutnum;
static INT32 picxpos, picypos, picnum, pictime, picmode, numpics, pictoloop;
static INT32 textxpos, textypos;
static boolean cutsceneover = false;
static boolean runningprecutscene = false, precutresetplayer = false;
static boolean runningprecutscene = false, precutresetplayer = false, precutFLS = false;

static void F_AdvanceToNextScene(void)
{
Expand Down Expand Up @@ -3928,7 +3928,7 @@ void F_EndCutScene(void)
if (runningprecutscene)
{
if (server)
D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, false);
D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, precutFLS);
}
else
{
Expand All @@ -3943,7 +3943,7 @@ void F_EndCutScene(void)
}
}

void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer)
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS)
{
if (!cutscenes[cutscenenum])
return;
Expand All @@ -3962,6 +3962,7 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset
cutsceneover = false;
runningprecutscene = precutscene;
precutresetplayer = resetplayer;
precutFLS = FLS;

scenenum = picnum = 0;
cutnum = cutscenenum;
Expand Down
2 changes: 1 addition & 1 deletion src/f_finale.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void F_EndingDrawer(void);
void F_CreditTicker(void);
void F_CreditDrawer(void);

void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS);
void F_CutsceneDrawer(void);
void F_EndCutScene(void);

Expand Down
12 changes: 6 additions & 6 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ consvar_t cv_cam_lockonboss[2] = {

consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_sideaxis = CVAR_INIT ("joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_jumpaxis = CVAR_INIT ("joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_spinaxis = CVAR_INIT ("joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_fireaxis = CVAR_INIT ("joyaxis_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
Expand All @@ -422,8 +422,8 @@ consvar_t cv_digitaldeadzone = CVAR_INIT ("joy_digdeadzone", "0.25", CV_FLOAT|CV

consvar_t cv_moveaxis2 = CVAR_INIT ("joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_sideaxis2 = CVAR_INIT ("joyaxis2_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_jumpaxis2 = CVAR_INIT ("joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_spinaxis2 = CVAR_INIT ("joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
consvar_t cv_fireaxis2 = CVAR_INIT ("joyaxis2_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
Expand Down Expand Up @@ -4108,7 +4108,7 @@ void G_AfterIntermission(void)
&& stagefailed == false)
{
// Start a custom cutscene.
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false);
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false, false);
}
else
{
Expand Down Expand Up @@ -4958,7 +4958,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
imcontinuing = false;

if ((gametyperules & GTR_CUTSCENES) && !skipprecutscene && mapheaderinfo[gamemap-1]->precutscenenum && !modeattacking && !(marathonmode & MA_NOCUTSCENES)) // Start a custom cutscene.
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer);
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer, FLS);
else
G_DoLoadLevel(resetplayer);

Expand Down
4 changes: 4 additions & 0 deletions src/p_enemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,10 @@ void A_PointyThink(mobj_t *actor)
if (!actor->tracer) // For some reason we do not have spike balls...
return;

// Catch case where actor lastlook is -1 (which segfaults the following blocks)
if (actor->lastlook < 0)
return;

// Position spike balls relative to the value of 'lastlook'.
ball = actor->tracer;

Expand Down
5 changes: 5 additions & 0 deletions src/p_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -3546,6 +3546,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage, damagetype);
if (P_MobjWasRemoved(target))
return (shouldForce == 1); // mobj was removed
if (P_MobjWasRemoved(source))
source = NULL;
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)
Expand Down Expand Up @@ -3763,6 +3765,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
else
P_SetMobjState(target, target->info->painstate);

if (P_MobjWasRemoved(target))
return false;

if (target->type == MT_HIVEELEMENTAL)
target->extravalue1 += 3;

Expand Down
15 changes: 14 additions & 1 deletion src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,20 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
P_SetPlayerMobjState(object, S_PLAY_ROLL);
}
else
pflags = object->player->pflags & (PF_STARTJUMP|PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_BOUNCING); // I still need these.
{
boolean wasSpindashing = object->player->dashspeed > 0 && (object->player->charability2 == CA2_SPINDASH);

pflags = object->player->pflags & (PF_STARTJUMP | PF_JUMPED | PF_NOJUMPDAMAGE | PF_SPINNING | PF_THOKKED | PF_BOUNCING); // I still need these.

if (wasSpindashing) // Ensure we're in the rolling state, and not spindash.
P_SetPlayerMobjState(object, S_PLAY_ROLL);

if (object->player->charability == CA_GLIDEANDCLIMB && object->player->skidtime && (pflags & PF_JUMPED))
{
object->player->skidtime = 0; // No skidding should be happening, either.
pflags &= ~PF_JUMPED;
}
}
secondjump = object->player->secondjump;
washoming = object->player->homing;
P_ResetPlayer(object->player);
Expand Down
7 changes: 7 additions & 0 deletions src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -6904,6 +6904,13 @@ static void P_AddOverlay(mobj_t *thing)
static void P_RemoveOverlay(mobj_t *thing)
{
mobj_t *mo;
if (overlaycap == thing)
{
P_SetTarget(&overlaycap, thing->hnext);
P_SetTarget(&thing->hnext, NULL);
return;
}

for (mo = overlaycap; mo; mo = mo->hnext)
{
if (mo->hnext != thing)
Expand Down
7 changes: 6 additions & 1 deletion src/y_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,12 @@ void Y_Ticker(void)
}

// emerald bounce
if (intertic <= 1)
if (dedicated || !LUA_HudEnabled(hud_intermissionemeralds))
{
// dedicated servers don't need this, especially since it crashes when stagefailed
// also skip this if Lua disabled intermission emeralds, so it doesn't play sounds
}
else if (intertic <= 1)
{
data.spec.emeraldbounces = 0;
data.spec.emeraldmomy = 20;
Expand Down

0 comments on commit f114761

Please sign in to comment.