mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Spawn Guard visual when player spawns, do not tie spawning to e-brake
Object already handles turning invisible if player has no Guard.
This commit is contained in:
parent
b0b7bf8185
commit
e67ab6a116
3 changed files with 22 additions and 22 deletions
20
src/k_kart.c
20
src/k_kart.c
|
|
@ -10106,26 +10106,6 @@ void K_KartEbrakeVisuals(player_t *p)
|
|||
if (!S_SoundPlaying(p->mo, sfx_s3kd9s))
|
||||
S_ReducedVFXSound(p->mo, sfx_s3kd9s, p);
|
||||
|
||||
// Block visuals
|
||||
// (These objects track whether a player is block-eligible on their own, no worries)
|
||||
if (!p->ebrakefor)
|
||||
{
|
||||
mobj_t *ring = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_BLOCKRING);
|
||||
P_SetTarget(&ring->target, p->mo);
|
||||
P_SetScale(ring, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(ring, p->mo);
|
||||
ring->renderflags &= ~RF_DONTDRAW;
|
||||
|
||||
mobj_t *body = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_BLOCKBODY);
|
||||
P_SetTarget(&body->target, p->mo);
|
||||
P_SetScale(body, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(body, p->mo);
|
||||
body->renderflags |= RF_DONTDRAW;
|
||||
|
||||
if (K_PlayerGuard(p))
|
||||
S_StartSound(body, sfx_s1af);
|
||||
}
|
||||
|
||||
// HOLD! bubble.
|
||||
if (!p->ebrakefor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
void Obj_BlockRingThink (mobj_t *ring)
|
||||
{
|
||||
if (P_MobjWasRemoved(ring->target) || !ring->target->player || !ring->target->player->ebrakefor)
|
||||
if (P_MobjWasRemoved(ring->target) || !ring->target->player)
|
||||
{
|
||||
P_RemoveMobj(ring);
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ void Obj_BlockRingThink (mobj_t *ring)
|
|||
|
||||
void Obj_BlockBodyThink (mobj_t *body)
|
||||
{
|
||||
if (P_MobjWasRemoved(body->target) || !body->target->player || !body->target->player->ebrakefor)
|
||||
if (P_MobjWasRemoved(body->target) || !body->target->player)
|
||||
{
|
||||
P_RemoveMobj(body);
|
||||
}
|
||||
|
|
|
|||
20
src/p_mobj.c
20
src/p_mobj.c
|
|
@ -11866,6 +11866,26 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
}
|
||||
}
|
||||
|
||||
// Block visuals
|
||||
// (These objects track whether a player is block-eligible on their own, no worries)
|
||||
if (!p->spectator)
|
||||
{
|
||||
mobj_t *ring = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_BLOCKRING);
|
||||
P_SetTarget(&ring->target, p->mo);
|
||||
P_SetScale(ring, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(ring, p->mo);
|
||||
ring->renderflags &= ~RF_DONTDRAW;
|
||||
|
||||
mobj_t *body = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_BLOCKBODY);
|
||||
P_SetTarget(&body->target, p->mo);
|
||||
P_SetScale(body, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(body, p->mo);
|
||||
body->renderflags |= RF_DONTDRAW;
|
||||
|
||||
if (K_PlayerGuard(p))
|
||||
S_StartSound(body, sfx_s1af);
|
||||
}
|
||||
|
||||
// I'm not refactoring the loop at the top of this file.
|
||||
pcount = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue