Merge public master

This commit is contained in:
Eidolon 2025-04-25 10:37:43 -05:00
commit b45f9a8ebf
7 changed files with 32 additions and 14 deletions

View file

@ -158,6 +158,7 @@ typedef enum
CR_SLIDING, CR_SLIDING,
CR_ZOOMTUBE, CR_ZOOMTUBE,
CR_DASHRING, CR_DASHRING,
CR_TRAPBUBBLE,
} carrytype_t; // carry } carrytype_t; // carry
/* /*

View file

@ -4700,7 +4700,10 @@ struct int_const_s const INT_CONST[] = {
// Carrying // Carrying
{"CR_NONE",CR_NONE}, {"CR_NONE",CR_NONE},
{"CR_SLIDING",CR_SLIDING},
{"CR_ZOOMTUBE",CR_ZOOMTUBE}, {"CR_ZOOMTUBE",CR_ZOOMTUBE},
{"CR_DASHRING",CR_DASHRING},
{"CR_TRAPBUBBLE",CR_TRAPBUBBLE},
// Character flags (skinflags_t) // Character flags (skinflags_t)
{"SF_MACHINE",SF_MACHINE}, {"SF_MACHINE",SF_MACHINE},

View file

@ -730,7 +730,7 @@ static void K_DropDashWait(player_t *player)
player->respawn.timer--; player->respawn.timer--;
if (player->pflags & PF_FAULT) if (player->pflags & PF_FAULT)
return; return;
if (leveltime % 8 == 0) if (leveltime % 8 == 0)
{ {
@ -877,6 +877,12 @@ static void K_HandleDropDash(player_t *player)
{ {
player->mo->colorized = false; player->mo->colorized = false;
} }
// if player got trapped inside a bubble but lost its bubble object in a unintended way, remove no gravity flag
if (((P_MobjWasRemoved(player->mo->tracer) || player->mo->tracer == NULL || (!P_MobjWasRemoved(player->mo->tracer) && player->mo->tracer && player->mo->tracer->type != MT_BUBBLESHIELDTRAP)) && player->carry == CR_TRAPBUBBLE) && (player->mo->flags & MF_NOGRAVITY))
{
player->mo->flags &= ~MF_NOGRAVITY;
player->carry = CR_NONE;
}
} }
else else
{ {

View file

@ -655,6 +655,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_SetTarget(&special->tracer, toucher); P_SetTarget(&special->tracer, toucher);
toucher->flags |= MF_NOGRAVITY; toucher->flags |= MF_NOGRAVITY;
toucher->momz = (8*toucher->scale) * P_MobjFlip(toucher); toucher->momz = (8*toucher->scale) * P_MobjFlip(toucher);
toucher->player->carry = CR_TRAPBUBBLE;
P_SetTarget(&toucher->tracer, special); //use tracer to acces the object
// Snap to the unfortunate player and quit moving laterally, or we can end up quite far away // Snap to the unfortunate player and quit moving laterally, or we can end up quite far away
special->momx = 0; special->momx = 0;

View file

@ -9441,7 +9441,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (leveltime % 180 == 0) if (leveltime % 180 == 0)
S_StartSound(mobj, sfx_s3kbfl); S_StartSound(mobj, sfx_s3kbfl);
if (mobj->tracer && !P_MobjWasRemoved(mobj->tracer) && mobj->tracer->player) if (mobj->tracer && !P_MobjWasRemoved(mobj->tracer) && mobj->tracer->tracer == mobj && mobj->tracer->player && mobj->tracer->player->carry == CR_TRAPBUBBLE)
{ {
player_t *player = mobj->tracer->player; player_t *player = mobj->tracer->player;
fixed_t destx, desty, curfz, destfz; fixed_t destx, desty, curfz, destfz;
@ -9489,6 +9489,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
{ {
S_StartSound(mobj->tracer, sfx_s3k77); S_StartSound(mobj->tracer, sfx_s3k77);
mobj->tracer->flags &= ~MF_NOGRAVITY; mobj->tracer->flags &= ~MF_NOGRAVITY;
mobj->tracer->player->carry = CR_NONE;
P_KillMobj(mobj, mobj->tracer, mobj->tracer, DMG_NORMAL); P_KillMobj(mobj, mobj->tracer, mobj->tracer, DMG_NORMAL);
break; break;
} }

View file

@ -785,9 +785,13 @@ static int cmp_loopends(const void *a, const void *b)
*mt2 = *(const mapthing_t*const*)b; *mt2 = *(const mapthing_t*const*)b;
// weighted sorting; tag takes precedence over type // weighted sorting; tag takes precedence over type
return const int maincomp = intsign(mt1->tid - mt2->tid) * 2 +
intsign(mt1->tid - mt2->tid) * 2 +
intsign(mt1->thing_args[0] - mt2->thing_args[0]); intsign(mt1->thing_args[0] - mt2->thing_args[0]);
// JugadorXEI (04/20/25): If a qsort comparison ends up with an equal result,
// it results in UNSPECIFIED BEHAVIOR, so assuming the previous two comparisons
// are equal, let's make it consistent with Linux behaviour (ascending order).
return maincomp != 0 ? maincomp : intsign((mt1 - mapthings) - (mt2 - mapthings));
} }
static void P_SpawnMapThings(boolean spawnemblems) static void P_SpawnMapThings(boolean spawnemblems)

View file

@ -419,7 +419,8 @@ void P_ResetPlayer(player_t *player)
{ {
//player->pflags &= ~(PF_); //player->pflags &= ~(PF_);
player->carry = CR_NONE; if (player->carry != CR_TRAPBUBBLE)
player->carry = CR_NONE;
player->onconveyor = 0; player->onconveyor = 0;
//player->drift = player->driftcharge = 0; //player->drift = player->driftcharge = 0;
@ -4545,17 +4546,17 @@ void P_PlayerThink(player_t *player)
if (player->nocontrol && player->nocontrol < UINT16_MAX) if (player->nocontrol && player->nocontrol < UINT16_MAX)
{ {
if (!(--player->nocontrol)) player->nocontrol--;
{
if (player->pflags & PF_FAULT)
{
player->pflags &= ~PF_FAULT;
player->mo->renderflags &= ~RF_DONTDRAW;
player->mo->flags &= ~MF_NOCLIPTHING;
}
}
} }
// tic down the var normaly and remove the flag upon respawn so its guaranteed to be removed from the player
if (!player->nocontrol && !player->respawn.timer && player->respawn.state == RESPAWNST_DROP && (player->pflags & PF_FAULT))
{
player->pflags &= ~PF_FAULT;
player->mo->renderflags &= ~RF_DONTDRAW;
player->mo->flags &= ~MF_NOCLIPTHING;
}
boolean deathcontrolled = (player->respawn.state != RESPAWNST_NONE && player->respawn.truedeath == true) boolean deathcontrolled = (player->respawn.state != RESPAWNST_NONE && player->respawn.truedeath == true)
|| (player->pflags & PF_NOCONTEST) || (player->karmadelay); || (player->pflags & PF_NOCONTEST) || (player->karmadelay);
boolean powercontrolled = (player->hyudorotimer) || (player->growshrinktimer > 0); boolean powercontrolled = (player->hyudorotimer) || (player->growshrinktimer > 0);