Shrink when dying post-finish

I started this in another commit and forgot to fully finish it. Also allows attacking bot-controlled players who won
This commit is contained in:
Sally Coolatta 2020-09-26 05:40:01 -04:00
parent 2cd2dae8eb
commit 17b8a5d603
3 changed files with 7 additions and 8 deletions

View file

@ -683,7 +683,8 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
// Remove any existing controls // Remove any existing controls
memset(cmd, 0, sizeof(ticcmd_t)); memset(cmd, 0, sizeof(ticcmd_t));
if (gamestate != GS_LEVEL) if (gamestate != GS_LEVEL
|| player->mo->scale == 0) // funny post-finish death
{ {
// No need to do anything else. // No need to do anything else.
return; return;

View file

@ -1650,7 +1650,8 @@ static boolean P_KillPlayer(player_t *player, UINT8 type)
{ {
if (player->exiting) if (player->exiting)
{ {
player->mo->destscale = 1; player->mo->destscale = 0;
player->mo->flags |= MF_NOCLIPTHING;
return false; return false;
} }
@ -1818,9 +1819,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (!force) if (!force)
{ {
if (player->exiting)
return false;
// Player hits another player // Player hits another player
if (source && source->player) if (source && source->player)
{ {
@ -1832,7 +1830,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Instant-Death // Instant-Death
if ((damagetype & DMG_DEATHMASK)) if ((damagetype & DMG_DEATHMASK))
{ {
P_KillPlayer(player, damagetype); if (!P_KillPlayer(player, damagetype))
return false;
} }
else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
{ {
@ -1840,7 +1839,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
} }
else else
{ {
// Check if the player is allowed to be damaged! // Check if the player is allowed to be damaged!
// If not, then spawn the instashield effect instead. // If not, then spawn the instashield effect instead.
if (!force) if (!force)

View file

@ -4674,7 +4674,7 @@ static void P_MobjScaleThink(mobj_t *mobj)
switch (mobj->type) switch (mobj->type)
{ {
default: default:
if (mobj->scale == 0) if (mobj->player == NULL && mobj->scale == 0)
{ {
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;