From bd90c203668eb4350e9df69b4eb834ef420ababe Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Feb 2020 16:24:13 -0800 Subject: [PATCH 1/3] Turn the shadow scale if-else into a switch statement, for sake of editing and in case object types ever change :sweat_drops: --- src/p_mobj.c | 70 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index f02ed4f84..10898f70e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10461,6 +10461,61 @@ void P_SceneryThinker(mobj_t *mobj) // GAME SPAWN FUNCTIONS // +static fixed_t P_DefaultMobjShadowScale (mobj_t *thing) +{ + switch (thing->type) + { + case MT_PLAYER: + case MT_ROLLOUTROCK: + + case MT_EGGMOBILE4_MACE: + case MT_SMALLMACE: + case MT_BIGMACE: + + case MT_SMALLGRABCHAIN: + case MT_BIGGRABCHAIN: + + case MT_YELLOWSPRINGBALL: + case MT_REDSPRINGBALL: + + return FRACUNIT; + + case MT_RING: + case MT_FLINGRING: + + case MT_BLUESPHERE: + case MT_FLINGBLUESPHERE: + case MT_BOMBSPHERE: + + case MT_REDTEAMRING: + case MT_BLUETEAMRING: + case MT_REDFLAG: + case MT_BLUEFLAG: + + case MT_EMBLEM: + + case MT_TOKEN: + case MT_EMERALD1: + case MT_EMERALD2: + case MT_EMERALD3: + case MT_EMERALD4: + case MT_EMERALD5: + case MT_EMERALD6: + case MT_EMERALD7: + case MT_EMERHUNT: + case MT_FLINGEMERALD: + + return 2*FRACUNIT/3; + + default: + + if (thing->flags & (MF_ENEMY|MF_BOSS)) + return FRACUNIT; + else + return 0; + } +} + // // P_SpawnMobj // @@ -10562,20 +10617,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->z = z; // Set shadowscale here, before spawn hook so that Lua can change it - if ( - type == MT_PLAYER || - type == MT_ROLLOUTROCK || - type == MT_EGGMOBILE4_MACE || - (type >= MT_SMALLMACE && type <= MT_REDSPRINGBALL) || - (mobj->flags & (MF_ENEMY|MF_BOSS)) - ) - mobj->shadowscale = FRACUNIT; - else if ( - type >= MT_RING && type <= MT_FLINGEMERALD && type != MT_EMERALDSPAWN - ) - mobj->shadowscale = 2*FRACUNIT/3; - else - mobj->shadowscale = 0; + mobj->shadowscale = P_DefaultMobjShadowScale(mobj); #ifdef HAVE_BLUA // DANGER! This can cause P_SpawnMobj to return NULL! From 9f7bfd901b591bd180d6b77b5241dd789303670c Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Tue, 11 Feb 2020 19:07:48 -0600 Subject: [PATCH 2/3] I broke SHIFT in the Connect IP Textbox.. whoops. It's okay, I literally had to remove one line lmao. --- src/m_menu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 049b66d67..01db26148 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -10585,7 +10585,6 @@ static void M_HandleConnectIP(INT32 choice) default: // otherwise do nothing. break; } - break; // don't check for typed keys } if (l >= 28-1) From ae2041d68633e3d089c29b6f146669d3f97b738a Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 11 Feb 2020 19:36:09 -0800 Subject: [PATCH 3/3] Remove extra tokens if we got all 7 emeroods --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index efc96a50f..aaab89163 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3739,7 +3739,10 @@ static void G_DoCompleted(void) } if (i == 7) + { gottoken = false; + token = 0; + } } if (spec && !gottoken)