From e4a74e91fcd34f9ad0baf59e43d228529d2ddd48 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Sat, 16 Jan 2016 16:33:19 -0600 Subject: [PATCH 1/3] - Puffs should not spawn on floors or ceilings with sky flats without the SKYEXPLODE flag. - Added line horizon check for puffs as well. --- src/p_map.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_map.cpp b/src/p_map.cpp index ce20c8430..b61c130ac 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -52,6 +52,7 @@ #include "p_conversation.h" #include "r_data/r_translate.h" #include "g_level.h" +#include "r_sky.h" CVAR(Bool, cl_bloodsplats, true, CVAR_ARCHIVE) CVAR(Int, sv_smartaim, 0, CVAR_ARCHIVE | CVAR_SERVERINFO) @@ -4293,6 +4294,8 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) { puff = P_SpawnPuff(source, puffclass, trace.X, trace.Y, trace.Z, (source->angle + angleoffset) - ANG90, 1, 0); + if (puff && (trace.Line->special == Line_Horizon) && !(puff->flags3 & MF3_SKYEXPLODE)) + puff->Destroy(); } if (puff != NULL && puffDefaults->flags7 & MF7_FORCEDECAL && puff->DecalGenerator) SpawnShootDecal(puff, trace); @@ -4306,6 +4309,12 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) { puff = P_SpawnPuff(source, puffclass, trace.X, trace.Y, trace.Z, (source->angle + angleoffset) - ANG90, 1, 0); + if (puff && !(puff->flags3 & MF3_SKYEXPLODE) && + (((trace.HitType == TRACE_HitFloor) && (puff->floorpic == skyflatnum)) || + ((trace.HitType == TRACE_HitCeiling) && (puff->ceilingpic == skyflatnum)))) + { + puff->Destroy(); + } } } if (thepuff != NULL) From 421dcacb94a95f3f5468d6f54e11f1829a88953a Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Sat, 16 Jan 2016 16:36:42 -0600 Subject: [PATCH 2/3] Added NULL check to lines. --- src/p_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index b61c130ac..5feff237e 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4294,7 +4294,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) { puff = P_SpawnPuff(source, puffclass, trace.X, trace.Y, trace.Z, (source->angle + angleoffset) - ANG90, 1, 0); - if (puff && (trace.Line->special == Line_Horizon) && !(puff->flags3 & MF3_SKYEXPLODE)) + if (puff && (trace.Line != NULL) && (trace.Line->special == Line_Horizon) && !(puff->flags3 & MF3_SKYEXPLODE)) puff->Destroy(); } if (puff != NULL && puffDefaults->flags7 & MF7_FORCEDECAL && puff->DecalGenerator) From 552c440afa904174cb11796ba61f5628b9179e35 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Jan 2016 13:29:44 +0200 Subject: [PATCH 3/3] Fixed another issue with Hexen Mac Hopefully there will be no more bugs with Hexen Mac IWADs (demo or full) as all extra lumps are now discarded --- src/w_wad.cpp | 59 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 552228557..42e5c17b9 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -961,8 +961,10 @@ void FWadCollection::RenameNerve () // // FixMacHexen // -// Rename unused high resolution font lumps because they are incorrectly -// treated as extended characters +// Discard all extra lumps in Mac version of Hexen IWAD (demo or full) +// to avoid any issues caused by names of these lumps, including: +// * Wrong height of small font +// * Broken life bar of mage class // //========================================================================== @@ -973,22 +975,51 @@ void FWadCollection::FixMacHexen() return; } - for (int i = GetFirstLump(IWAD_FILENUM), last = GetLastLump(IWAD_FILENUM); i <= last; ++i) + FileReader* const reader = GetFileReader(IWAD_FILENUM); + const long iwadSize = reader->GetLength(); + + static const long DEMO_SIZE = 13596228; + static const long FULL_SIZE = 21078584; + + if ( DEMO_SIZE != iwadSize + && FULL_SIZE != iwadSize) { - assert(IWAD_FILENUM == LumpInfo[i].wadnum); + return; + } - FResourceLump* const lump = LumpInfo[i].lump; - char* const name = lump->Name; + reader->Seek(0, SEEK_SET); - // Unwanted lumps are named like FONTA??1 + BYTE checksum[16]; + MD5Context md5; + md5.Update(reader, iwadSize); + md5.Final(checksum); - if (8 == strlen(name) - && MAKE_ID('F', 'O', 'N', 'T') == lump->dwName - && 'A' == name[4] && '1' == name[7] - && isdigit(name[5]) && isdigit(name[6])) - { - name[0] = '\0'; - } + static const BYTE HEXEN_DEMO_MD5[16] = + { + 0x92, 0x5f, 0x9f, 0x50, 0x00, 0xe1, 0x7d, 0xc8, + 0x4b, 0x0a, 0x6a, 0x3b, 0xed, 0x3a, 0x6f, 0x31 + }; + + static const BYTE HEXEN_FULL_MD5[16] = + { + 0xb6, 0x81, 0x40, 0xa7, 0x96, 0xf6, 0xfd, 0x7f, + 0x3a, 0x5d, 0x32, 0x26, 0xa3, 0x2b, 0x93, 0xbe + }; + + if ( 0 != memcmp(HEXEN_DEMO_MD5, checksum, sizeof checksum) + && 0 != memcmp(HEXEN_FULL_MD5, checksum, sizeof checksum)) + { + return; + } + + static const int EXTRA_LUMPS = 299; + + const int lastLump = GetLastLump(IWAD_FILENUM); + assert(GetFirstLump(IWAD_FILENUM) + 299 < lastLump); + + for (int i = lastLump - EXTRA_LUMPS + 1; i <= lastLump; ++i) + { + LumpInfo[i].lump->Name[0] = '\0'; } }