From 34908c9b29699881cafe6f914a945e7e923dfba4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 6 Aug 2017 18:57:02 +0100 Subject: [PATCH 1/4] Re-order P_RemoveShield's first/second layer shield code --- src/p_inter.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 4bd9b998a..3ae68814c 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2920,7 +2920,17 @@ void P_RemoveShield(player_t *player) else player->powers[pw_shield] &= SH_STACK; } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE) + else if (player->powers[pw_shield] & SH_NOSTACK) + { // First layer shields + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them! + { + P_BlackOw(player); // BAM! + player->pflags |= PF_JUMPDOWN; + } + else + player->powers[pw_shield] &= SH_STACK; + } + else { // Second layer shields if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) { @@ -2929,13 +2939,6 @@ void P_RemoveShield(player_t *player) } player->powers[pw_shield] = SH_NONE; } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them! - { - P_BlackOw(player); // BAM! - player->pflags |= PF_JUMPDOWN; - } - else - player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) From a0204c67221885a72eaa204aa61f7dcb076eab54 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 6 Aug 2017 22:10:29 +0100 Subject: [PATCH 2/4] Made P_SpecialStageDamage for the lose 10 rings damaging code shared by spikeballs and SS damage sector special --- src/p_inter.c | 58 +++++++++++++++++++++++++++++++-------------------- src/p_local.h | 1 + src/p_spec.c | 23 +++----------------- 3 files changed, 39 insertions(+), 43 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 3ae68814c..4686c68f8 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1493,30 +1493,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_SetMobjState(special, special->info->deathstate); return; case MT_SPECIALSPIKEBALL: - if (!(!useNightsSS && G_IsSpecialStage(gamemap))) // Only for old special stages - { - P_DamageMobj(toucher, special, special, 1, 0); - return; - } - - if (player->powers[pw_invulnerability] || player->powers[pw_flashing] - || player->powers[pw_super]) - return; - if (player->powers[pw_shield] || player->bot) //If One-Hit Shield - { - P_RemoveShield(player); - S_StartSound(toucher, sfx_shldls); // Ba-Dum! Shield loss. - } + if (!useNightsSS && G_IsSpecialStage(gamemap)) // Only for old special stages + P_SpecialStageDamage(player, special, NULL); else - { - P_PlayRinglossSound(toucher); - if (player->rings >= 10) - player->rings -= 10; - else - player->rings = 0; - } - - P_DoPlayerPain(player, special, NULL); + P_DamageMobj(toucher, special, special, 1, 0); return; case MT_EGGMOBILE2_POGO: // sanity checks @@ -3008,6 +2988,38 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN player->rings = 0; } +// +// P_SpecialStageDamage +// +// Do old special stage-style damaging +// Removes 10 rings from the player, or knocks off their shield if they have one. +// If they don't have anything, just knock the player back anyway (this doesn't kill them). +// +void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source) +{ + if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super]) + return; + + if (player->powers[pw_shield] || player->bot) //If One-Hit Shield + { + P_RemoveShield(player); + S_StartSound(player->mo, sfx_shldls); // Ba-Dum! Shield loss. + } + else + { + P_PlayRinglossSound(player->mo); + if (player->rings >= 10) + player->rings -= 10; + else + player->rings = 0; + } + + P_DoPlayerPain(player, inflictor, source); + + if (gametype == GT_CTF && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)) + P_PlayerFlagBurst(player, false); +} + /** Damages an object, which may or may not be a player. * For melee attacks, source and inflictor are the same. * diff --git a/src/p_local.h b/src/p_local.h index a2831222a..64ab47975 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -414,6 +414,7 @@ void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duratio void P_ForceConstant(const BasicFF_t *FFInfo); void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End); void P_RemoveShield(player_t *player); +void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source); boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype); void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c diff --git a/src/p_spec.c b/src/p_spec.c index 8a3ac0748..03ee30281 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3660,31 +3660,14 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers S_StartSound(player->mo, sfx_itemup); } break; - case 11: // Special Stage Damage - Kind of like a mini-P_DamageMobj() - if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super] || player->exiting || player->bot) + case 11: // Special Stage Damage + if (player->exiting || player->bot) // Don't do anything for bots or players who have just finished break; if (!(player->powers[pw_shield] || player->rings > 0)) // Don't do anything if no shield or rings anyway break; - if (player->powers[pw_shield]) - { - P_RemoveShield(player); - S_StartSound(player->mo, sfx_shldls); // Ba-Dum! Shield loss. - } - else if (player->rings > 0) - { - P_PlayRinglossSound(player->mo); - if (player->rings >= 10) - player->rings -= 10; - else - player->rings = 0; - } - - P_DoPlayerPain(player, NULL, NULL); // this does basically everything that was here before - - if (gametype == GT_CTF && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)) - P_PlayerFlagBurst(player, false); + P_SpecialStageDamage(player, NULL, NULL); break; case 12: // Space Countdown if (!(player->powers[pw_shield] & SH_PROTECTWATER) && !player->powers[pw_spacetime]) From 9805b82feca902d798301e26c9dce1f0a1f91419 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 18 Aug 2017 18:14:03 +0100 Subject: [PATCH 3/4] Disable "connect self" due to being broken, cleaned up ip+port part Anyone know if "connect any" work at all? Would have disabled that too but apparently the game uses it if "-connect" is given with no params --- src/d_clisrv.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 3878d8795..bb0978cdb 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2253,7 +2253,8 @@ static void Command_connect(void) CONS_Printf(M_GetText( "Connect (port): connect to a server\n" "Connect ANY: connect to the first lan server found\n" - "Connect SELF: connect to your own server.\n")); + //"Connect SELF: connect to your own server.\n" + )); return; } @@ -2267,7 +2268,7 @@ static void Command_connect(void) // we don't request a restart unless the filelist differs server = false; - +/* if (!stricmp(COM_Argv(1), "self")) { servernode = 0; @@ -2276,6 +2277,7 @@ static void Command_connect(void) //SV_SpawnServer(); } else +*/ { // used in menu to connect to a server in the list if (netgame && !stricmp(COM_Argv(1), "node")) @@ -2299,10 +2301,13 @@ static void Command_connect(void) if (!stricmp(COM_Argv(1), "any")) servernode = BROADCASTADDR; - else if (I_NetMakeNodewPort && COM_Argc() >= 3) - servernode = I_NetMakeNodewPort(COM_Argv(1), COM_Argv(2)); else if (I_NetMakeNodewPort) - servernode = I_NetMakeNode(COM_Argv(1)); + { + if (COM_Argc() >= 3) // address AND port + servernode = I_NetMakeNodewPort(COM_Argv(1), COM_Argv(2)); + else // address only, or address:port + servernode = I_NetMakeNode(COM_Argv(1)); + } else { CONS_Alert(CONS_ERROR, M_GetText("There is no server identification with this network driver\n")); From d4141ae2302f229cc8e6e0836281a0c9d66f27a6 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 19 Aug 2017 18:51:56 +0100 Subject: [PATCH 4/4] Remove unused floorinfo_t struct and some unused vars in the hardware code --- src/hardware/hw_main.c | 2 -- src/hardware/hw_main.h | 12 +----------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d74cd0587..5ecde8a0b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4753,8 +4753,6 @@ static polyplaneinfo_t *polyplaneinfo = NULL; #ifndef SORTING size_t numfloors = 0; #else -//static floorinfo_t *floorinfo = NULL; -//static size_t numfloors = 0; //Hurdler: 3D water sutffs typedef struct gr_drawnode_s { diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index b0a14d3b5..cb49f817c 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -46,8 +46,7 @@ void HWR_SetViewSize(void); void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option); void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, const UINT8 *colormap); void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); -void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, INT32 option, fixed_t scale, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); -void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); +void HWR_MakePatch(const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); void HWR_CreatePlanePolygons(INT32 bspnum); void HWR_CreateStaticLightmaps(INT32 bspnum); void HWR_PrepLevelCache(size_t pnumtextures); @@ -104,13 +103,4 @@ extern float gr_viewwindowx, gr_basewindowcentery; extern fixed_t *hwbbox; extern FTransform atransform; -typedef struct -{ - wallVert3D floorVerts[4]; - FSurfaceInfo Surf; - INT32 texnum; - INT32 blend; - INT32 drawcount; -} floorinfo_t; - #endif