From 0862aece9ff4f4e99d9726ea77c0a3153bd5da76 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 14 Aug 2018 17:21:49 -0400 Subject: [PATCH] Ideya fixes when a player has more than one Ideya # Conflicts: # src/p_inter.c --- src/p_inter.c | 11 +++++++---- src/p_mobj.c | 1 + src/p_user.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 66c6bd852..6378762ea 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -803,8 +803,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) mobj_t *hnext = orbittarget->hnext; P_SetTarget(&orbittarget->hnext, toucher->tracer); - P_SetTarget(&orbittarget->hnext->hnext, hnext); // Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. - P_SetTarget(&orbittarget->hnext->target, orbittarget); // goalpost + if (!orbittarget->hnext->hnext) + P_SetTarget(&orbittarget->hnext->hnext, hnext); // Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. + else + P_SetTarget(&orbittarget->hnext->hnext->target, orbittarget); + P_SetTarget(&orbittarget->hnext->target, orbittarget); P_SetTarget(&toucher->tracer, NULL); if (hnext) @@ -962,8 +965,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (player->powers[pw_carry] == CR_NIGHTSMODE && !toucher->target) return; - if (toucher->tracer) - return; // Don't have multiple ideya + if (toucher->tracer && toucher->tracer->health > 0) + return; // Don't have multiple ideya, unless it's the first one given (health = 0) if (player->mare != special->threshold) // wrong mare return; diff --git a/src/p_mobj.c b/src/p_mobj.c index c7efd9081..19c140d40 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9612,6 +9612,7 @@ void P_SpawnPlayer(INT32 playernum) if (p == players) // this is totally the wrong place to do this aaargh. { mobj_t *idya = P_SpawnMobjFromMobj(mobj, 0, 0, mobj->height, MT_GOTEMERALD); + idya->health = 0; // for identification P_SetTarget(&idya->target, mobj); P_SetMobjState(idya, mobjinfo[MT_GOTEMERALD].missilestate); P_SetTarget(&mobj->tracer, idya); diff --git a/src/p_user.c b/src/p_user.c index 8c50b5095..877910f25 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6055,6 +6055,7 @@ static void P_DoNiGHTSCapsule(player_t *player) UINT8 em = P_GetNextEmerald(); // Only give it to ONE person, and THAT player has to get to the goal! mobj_t *emmo = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height, MT_GOTEMERALD); + emmo->health = em; // for identification P_SetTarget(&emmo->target, player->mo); P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em); P_SetTarget(&player->mo->tracer, emmo); @@ -6081,8 +6082,17 @@ static void P_DoNiGHTSCapsule(player_t *player) }*/ mobj_t *idya = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height, MT_GOTEMERALD); idya->extravalue2 = player->mare/5; + idya->health = player->mare + 1; // for identification P_SetTarget(&idya->target, player->mo); P_SetMobjState(idya, mobjinfo[MT_GOTEMERALD].missilestate + ((player->mare + 1) % 5)); + + if (player->mo->tracer) + { + P_SetTarget(&idya->hnext, player->mo->tracer); + idya->extravalue1 = (angle_t)(player->mo->tracer->extravalue1 - 72*ANG1); + if (idya->extravalue1 > player->mo->tracer->extravalue1) + idya->extravalue1 -= (72*ANG1)/idya->extravalue1; + } P_SetTarget(&player->mo->tracer, idya); } for (i = 0; i < MAXPLAYERS; i++)