From e1b645d103377f2592973506d7f1568b7087caaa Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 8 Sep 2018 17:50:53 +0100 Subject: [PATCH] Bugfix a Jawz crash Jeck got a few days ago. Not menu-based, but I guess this branch is misc PLUS menu stuff, not just menu stuff based on sal-misc. --- src/k_kart.c | 25 ++++++++++++++++--------- src/p_enemy.c | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ba2d03d9..496be1b5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2170,16 +2170,23 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle th->momx = FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT)); th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); - if (type == MT_ORBINAUT) + switch (type) { - if (source && source->player) - th->color = source->player->skincolor; - else - th->color = SKINCOLOR_CLOUDY; - } - else if (type == MT_JAWZ || type == MT_JAWZ_DUD) - { - S_StartSound(th, th->info->activesound); + case MT_ORBINAUT: + if (source && source->player) + th->color = source->player->skincolor; + else + th->color = SKINCOLOR_CLOUDY; + break; + case MT_JAWZ: + if (source && source->player) + th->cvmem = source->player->skincolor; + else + th->cvmem = SKINCOLOR_RED; + //fallthrough + case MT_JAWZ_DUD: + S_StartSound(th, th->info->activesound); + break; } x = x + P_ReturnThrustX(source, an, source->radius + th->radius); diff --git a/src/p_enemy.c b/src/p_enemy.c index 83011674..a6c124db 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8182,7 +8182,7 @@ void A_JawzChase(mobj_t *actor) ret = P_SpawnMobj(actor->tracer->x, actor->tracer->y, actor->tracer->z, MT_PLAYERRETICULE); P_SetTarget(&ret->target, actor->tracer); ret->frame |= ((leveltime % 10) / 2) + 5; - ret->color = actor->target->player->skincolor; + ret->color = actor->cvmem; P_Thrust(actor, R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y), actor->info->speed); return;