From 21703c1504a00ec6408b8c87d54da3ceb32030ee Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 10 May 2023 21:53:35 -0700 Subject: [PATCH] Orbinaut shield: fix dropped state - Fixes dropped orbinauts driving in circles - Fixes dropped orbinauts not stopping once land on ground --- src/k_kart.c | 15 +++++++++++++-- src/k_objects.h | 1 + src/objects/orbinaut.c | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2e3bffd7c..a54976d09 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6276,7 +6276,14 @@ void K_DropHnextList(player_t *player) dropwork->flags &= ~(MF_NOCLIP|MF_NOCLIPTHING); } - dropwork->flags2 |= MF2_AMBUSH; + if (type == MT_ORBINAUT) + { + Obj_OrbinautDrop(dropwork); + } + else + { + dropwork->flags2 |= MF2_AMBUSH; + } dropwork->z += flip; @@ -6290,7 +6297,11 @@ void K_DropHnextList(player_t *player) P_Thrust(dropwork, work->angle - ANGLE_90, 6*mapobjectscale); dropwork->movecount = 2; - dropwork->movedir = work->angle - ANGLE_90; + + // TODO: movedir doesn't seem to be used by + // anything. It conflicts with orbinaut_flags so + // is commented out. + //dropwork->movedir = work->angle - ANGLE_90; P_SetMobjState(dropwork, dropwork->info->deathstate); diff --git a/src/k_objects.h b/src/k_objects.h index de8a558ae..605206ec7 100644 --- a/src/k_objects.h +++ b/src/k_objects.h @@ -52,6 +52,7 @@ void Obj_OrbinautThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir); void Obj_GachaBomThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir); void Obj_OrbinautJawzMoveHeld(player_t *player); boolean Obj_GachaBomWasTossed(mobj_t *th); +void Obj_OrbinautDrop(mobj_t *th); /* Jawz */ void Obj_JawzThink(mobj_t *th); diff --git a/src/objects/orbinaut.c b/src/objects/orbinaut.c index f7c2ac89a..6975386d8 100644 --- a/src/objects/orbinaut.c +++ b/src/objects/orbinaut.c @@ -441,3 +441,8 @@ boolean Obj_GachaBomWasTossed(mobj_t *th) { return (orbinaut_flags(th) & ORBI_TOSSED) == ORBI_TOSSED; } + +void Obj_OrbinautDrop(mobj_t *th) +{ + orbinaut_flags(th) |= ORBI_DROPPED; +}