From 66a7adfc34e1b82d45ec62f66eed194ff5805570 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 31 Oct 2018 04:46:24 -0400 Subject: [PATCH] Push fakes away from other items Prevents stupid item stacking in Battle (you can still do it with bananas, but THOSE are removable, and don't have a similar sprite) --- src/p_map.c | 25 +++++++++++++++++++++++++ src/p_mobj.c | 1 + 2 files changed, 26 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index 0078a969..2bcfd73a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -665,8 +665,33 @@ static boolean PIT_CheckThing(mobj_t *thing) // SRB2kart 011617 - Colission code for kart items //{ + // Push fakes out of other items + if (tmthing->type == MT_FAKEITEM && (thing->type == MT_RANDOMITEM || thing->type == MT_FAKEITEM)) + { + // see if it went over / under + if (tmthing->z > thing->z + thing->height) + return true; // overhead + if (tmthing->z + tmthing->height < thing->z) + return true; // underneath + + P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y), thing->radius/4); + return true; + } + else if (thing->type == MT_FAKEITEM && (tmthing->type == MT_RANDOMITEM || tmthing->type == MT_FAKEITEM)) + { + // see if it went over / under + if (tmthing->z > thing->z + thing->height) + return true; // overhead + if (tmthing->z + tmthing->height < thing->z) + return true; // underneath + + P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y), tmthing->radius/4); + return true; + } + if (tmthing->type == MT_RANDOMITEM) return true; + if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD || tmthing->type == MT_ORBINAUT_SHIELD || tmthing->type == MT_JAWZ_SHIELD) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 9802c88e..407ddc39 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8151,6 +8151,7 @@ void P_MobjThinker(mobj_t *mobj) } case MT_BANANA: case MT_FAKEITEM: + mobj->friction = ORIG_FRICTION/4; if (mobj->momx || mobj->momy) P_SpawnGhostMobj(mobj); if (mobj->z <= mobj->floorz && mobj->health > 1)