From 4d6532d303e1faa4829b815d5837ae8d56984204 Mon Sep 17 00:00:00 2001 From: yqco Date: Fri, 22 Jul 2016 02:35:44 -0600 Subject: [PATCH 1/2] Added RGF_NORANDOMPUFFZ flag for A_CustomRailgun and A_RailAttack --- src/p_local.h | 1 + src/p_map.cpp | 16 +++++++++++----- wadsrc/static/actors/constants.txt | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 42b4da7e7f..4b8b40a852 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -372,6 +372,7 @@ enum // P_RailAttack / A_RailAttack / A_CustomRailgun / P_DrawRailTrail flags RAF_EXPLICITANGLE = 4, RAF_FULLBRIGHT = 8, RAF_CENTERZ = 16, + RAF_NORANDOMPUFFZ = 32, }; diff --git a/src/p_map.cpp b/src/p_map.cpp index 1684ee5341..106c931527 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4725,6 +4725,12 @@ void P_RailAttack(FRailParams *p) } } + int puffflags = 0; + if (p->flags & RAF_NORANDOMPUFFZ) + { + puffflags |= PF_NORANDOMZ; + } + DVector2 xy = source->Vec2Angle(p->offset_xy, angle - 90.); RailData rail_data; @@ -4777,7 +4783,7 @@ void P_RailAttack(FRailParams *p) bool spawnpuff; bool bleed = false; - int puffflags = PF_HITTHING; + int actorpuffflags = puffflags | PF_HITTHING; AActor *hitactor = rail_data.RailHits[i].HitActor; DVector3 &hitpos = rail_data.RailHits[i].HitPos; DAngle hitangle = rail_data.RailHits[i].HitAngle; @@ -4790,7 +4796,7 @@ void P_RailAttack(FRailParams *p) else { spawnpuff = (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF); - puffflags |= PF_HITTHINGBLEED; // [XA] Allow for puffs to jump to XDeath state. + actorpuffflags |= PF_HITTHINGBLEED; // [XA] Allow for puffs to jump to XDeath state. if (!(puffDefaults->flags3 & MF3_BLOODLESSIMPACT)) { bleed = true; @@ -4798,7 +4804,7 @@ void P_RailAttack(FRailParams *p) } if (spawnpuff) { - P_SpawnPuff(source, puffclass, hitpos, hitangle, hitangle - 90, 1, puffflags, hitactor); + P_SpawnPuff(source, puffclass, hitpos, hitangle, hitangle - 90, 1, actorpuffflags, hitactor); } int dmgFlagPass = DMG_INFLICTOR_IS_PUFF; @@ -4827,7 +4833,7 @@ void P_RailAttack(FRailParams *p) if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) { - puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, 0); + puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, puffflags); if (puff && (trace.Line != NULL) && (trace.Line->special == Line_Horizon) && !(puff->flags3 & MF3_SKYEXPLODE)) puff->Destroy(); } @@ -4842,7 +4848,7 @@ void P_RailAttack(FRailParams *p) AActor* puff = NULL; if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) { - puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, 0); + puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, puffflags); if (puff && !(puff->flags3 & MF3_SKYEXPLODE) && (((trace.HitType == TRACE_HitFloor) && (puff->floorpic == skyflatnum)) || ((trace.HitType == TRACE_HitCeiling) && (puff->ceilingpic == skyflatnum)))) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index ba0d1399db..8fbcd78e85 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -171,6 +171,7 @@ const int RGF_NOPIERCING = 2; const int RGF_EXPLICITANGLE = 4; const int RGF_FULLBRIGHT = 8; const int RGF_CENTERZ = 16; +const int RGF_NORANDOMPUFFZ = 32; // Flags for A_Mushroom const int MSF_Standard = 0; From a1a0bdefffef6e735effab3864aa2d8198a6d4f4 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 23 Jul 2016 11:09:52 +0300 Subject: [PATCH 2/2] Added support for older versions of DeHackEd patches Patches from DeHackEd 2.3 and 2.4 are now loaded without warnings/errors --- src/d_dehacked.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 387e05be59..29a087facd 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2507,7 +2507,7 @@ static bool DoDehPatch() cont = 0; if (0 == strncmp (PatchFile, "Patch File for DeHackEd v", 25)) { - if (PatchFile[25] < '3') + if (PatchFile[25] < '3' && PatchFile[25] != '2' && PatchFile[27] != '3') { Printf (PRINT_BOLD, "\"%s\" is an old and unsupported DeHackEd patch\n", PatchName); delete[] PatchName; @@ -2544,7 +2544,7 @@ static bool DoDehPatch() {} } - if (pversion != 6) + if (pversion != 5 && pversion != 6) { Printf ("DeHackEd patch version is %d.\nUnexpected results may occur.\n", pversion); }