Most minor 1up icon bug fixed.

1up icons were spawning their overlays off sync with each other so the face icon was showing up during static. Now they don't.
(They'd do this in 2.1 too if you have a custom WAD added that doesn't have an overlay sprite, and you use it in multiplayer alongside a character that does.)
This commit is contained in:
Inuyasha 2016-01-06 03:07:08 -08:00
parent dcde68912a
commit c1340b6e6c
2 changed files with 24 additions and 8 deletions

View file

@ -1268,7 +1268,7 @@ state_t states[NUMSTATES] =
{SPR_TVEL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_ELEMENTAL_BOX {SPR_TVEL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_ELEMENTAL_BOX
{SPR_TVSS, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SNEAKERS_BOX {SPR_TVSS, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SNEAKERS_BOX
{SPR_TVIV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_INVULN_BOX {SPR_TVIV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_INVULN_BOX
{SPR_TV1P, 0, 2, {A_1upThinker}, 0, 0, S_BOX_FLICKER}, // S_1UP_BOX {SPR_TV1U, 0, 2, {A_1upThinker}, 0, 0, S_BOX_FLICKER}, // S_1UP_BOX
{SPR_TVEG, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_EGGMAN_BOX {SPR_TVEG, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_EGGMAN_BOX
{SPR_TVMX, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_MIXUP_BOX {SPR_TVMX, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_MIXUP_BOX
{SPR_TVGV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_GRAVITY_BOX {SPR_TVGV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_GRAVITY_BOX
@ -1353,11 +1353,11 @@ state_t states[NUMSTATES] =
{SPR_TVIV, 5, 4, {NULL}, 0, 0, S_INVULN_ICON5}, // S_INVULN_ICON4 {SPR_TVIV, 5, 4, {NULL}, 0, 0, S_INVULN_ICON5}, // S_INVULN_ICON4
{SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON5 {SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON5
{SPR_TV1P, 2, 4, {NULL}, 0, 0, S_1UP_ICON2}, // S_1UP_ICON1 {SPR_TV1U, 2, 4, {NULL}, 0, 0, S_1UP_ICON2}, // S_1UP_ICON1
{SPR_TV1U, 3, 4, {NULL}, 0, 0, S_1UP_ICON3}, // S_1UP_ICON2 {SPR_TV1U, 3, 4, {NULL}, 0, 0, S_1UP_ICON3}, // S_1UP_ICON2
{SPR_TV1U, 4, 4, {NULL}, 0, 0, S_1UP_ICON4}, // S_1UP_ICON3 {SPR_TV1U, 4, 4, {NULL}, 0, 0, S_1UP_ICON4}, // S_1UP_ICON3
{SPR_TV1U, 5, 4, {NULL}, 0, 0, S_1UP_ICON5}, // S_1UP_ICON4 {SPR_TV1U, 5, 4, {NULL}, 0, 0, S_1UP_ICON5}, // S_1UP_ICON4
{SPR_TV1P, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON5 {SPR_TV1U, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON5
{SPR_TVEG, 2, 4, {NULL}, 0, 0, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 {SPR_TVEG, 2, 4, {NULL}, 0, 0, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1
{SPR_TVEG, 3, 4, {NULL}, 0, 0, S_EGGMAN_ICON3}, // S_EGGMAN_ICON2 {SPR_TVEG, 3, 4, {NULL}, 0, 0, S_EGGMAN_ICON3}, // S_EGGMAN_ICON2

View file

@ -2541,7 +2541,6 @@ void A_1upThinker(mobj_t *actor)
if (closestplayer == -1 || skins[players[closestplayer].skin].sprites[SPR2_LIFE].numframes == 0) if (closestplayer == -1 || skins[players[closestplayer].skin].sprites[SPR2_LIFE].numframes == 0)
{ // Closest player not found (no players in game?? may be empty dedicated server!), or does not have correct sprite. { // Closest player not found (no players in game?? may be empty dedicated server!), or does not have correct sprite.
actor->sprite = SPR_TV1U;
if (actor->tracer) { if (actor->tracer) {
P_RemoveMobj(actor->tracer); P_RemoveMobj(actor->tracer);
actor->tracer = NULL; actor->tracer = NULL;
@ -2549,11 +2548,19 @@ void A_1upThinker(mobj_t *actor)
return; return;
} }
// We're using the overlay, so use the overlay 1up box (no text)
actor->sprite = SPR_TV1P;
if (!actor->tracer) if (!actor->tracer)
{ {
P_SetTarget(&actor->tracer, P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY)); P_SetTarget(&actor->tracer, P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY));
P_SetTarget(&actor->tracer->target, actor); P_SetTarget(&actor->tracer->target, actor);
P_SetMobjState(actor->tracer, actor->info->seestate); P_SetMobjState(actor->tracer, actor->info->seestate);
// The overlay is going to be one tic early turning off and on
// because it's going to get its thinker run the frame we spawned it.
// So make it take one tic longer if it just spawned.
++actor->tracer->tics;
} }
actor->tracer->color = players[closestplayer].mo->color; actor->tracer->color = players[closestplayer].mo->color;
@ -2621,7 +2628,7 @@ void A_MonitorPop(mobj_t *actor)
|| !newmobj->target->player || !newmobj->target->player
|| !newmobj->target->skin || !newmobj->target->skin
|| ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0)
newmobj->sprite = SPR_TV1U; // No lives icon for this player, use the default. {} // No lives icon for this player, use the default.
else else
{ // Spawn the lives icon. { // Spawn the lives icon.
mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY); mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY);
@ -2631,6 +2638,9 @@ void A_MonitorPop(mobj_t *actor)
livesico->color = newmobj->target->player->mo->color; livesico->color = newmobj->target->player->mo->color;
livesico->skin = &skins[newmobj->target->player->skin]; livesico->skin = &skins[newmobj->target->player->skin];
P_SetMobjState(livesico, newmobj->info->seestate); P_SetMobjState(livesico, newmobj->info->seestate);
// We're using the overlay, so use the overlay 1up sprite (no text)
newmobj->sprite = SPR_TV1P;
} }
} }
} }
@ -2702,7 +2712,7 @@ void A_GoldMonitorPop(mobj_t *actor)
|| !newmobj->target->player || !newmobj->target->player
|| !newmobj->target->skin || !newmobj->target->skin
|| ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0)
newmobj->sprite = SPR_TV1U; // No lives icon for this player, use the default. {} // No lives icon for this player, use the default.
else else
{ // Spawn the lives icon. { // Spawn the lives icon.
mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY); mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY);
@ -2712,6 +2722,9 @@ void A_GoldMonitorPop(mobj_t *actor)
livesico->color = newmobj->target->player->mo->color; livesico->color = newmobj->target->player->mo->color;
livesico->skin = &skins[newmobj->target->player->skin]; livesico->skin = &skins[newmobj->target->player->skin];
P_SetMobjState(livesico, newmobj->info->seestate); P_SetMobjState(livesico, newmobj->info->seestate);
// We're using the overlay, so use the overlay 1up sprite (no text)
newmobj->sprite = SPR_TV1P;
} }
} }
} }
@ -3241,8 +3254,11 @@ void A_ExtraLife(mobj_t *actor)
player = actor->target->player; player = actor->target->player;
if (actor->type == MT_1UP_ICON && !actor->tracer) if (actor->type == MT_1UP_ICON && actor->tracer)
actor->sprite = SPR_TV1U; // No lives icon for this player, use the default. {
// We're using the overlay, so use the overlay 1up sprite (no text)
actor->sprite = SPR_TV1P;
}
if (ultimatemode) //I don't THINK so! if (ultimatemode) //I don't THINK so!
{ {