From 35c30ab62fee6cdd3e746aeeacebcfbfeadbe60c Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Sat, 16 Jul 2016 20:28:43 -0500 Subject: [PATCH 1/8] Fixed missing constants. --- wadsrc/static/actors/constants.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 46e810a7f..05049e598 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -38,6 +38,9 @@ const int CBAF_NORANDOM = 2; const int CBAF_EXPLICITANGLE = 4; const int CBAF_NOPITCH = 8; const int CBAF_NORANDOMPUFFZ = 16; +const int CBAF_PUFFTARGET = 32; +const int CBAF_PUFFMASTER = 64; +const int CBAF_PUFFTRACER = 128; // Flags for A_GunFlash const int GFF_NOEXTCHANGE = 1; @@ -210,6 +213,9 @@ const int CPF_STEALARMOR = 32; const int FPF_AIMATANGLE = 1; const int FPF_TRANSFERTRANSLATION = 2; const int FPF_NOAUTOAIM = 4; +const int FBF_PUFFTARGET = 64; +const int FBF_PUFFMASTER = 128; +const int FBF_PUFFTRACER = 256; // Flags for A_Teleport enum From 39042dc4bf11226d3cfe8a28a64703f622d97c6e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Jul 2016 08:15:23 +0300 Subject: [PATCH 2/8] macOS application controller is now using proper delegate protocol Fixes compilation error with Xcode 8: cannot initialize a parameter of type 'id _Nullable' with an lvalue of type 'ApplicationController *' --- src/posix/cocoa/i_main.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index 5729a3716..bbe344809 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -220,8 +220,8 @@ int OriginalMain(int argc, char** argv) @interface ApplicationController : NSResponder -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 + #endif { } From e482a543891b755b7a2b2a7546e7187983daef62 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sat, 16 Jul 2016 16:07:31 +0200 Subject: [PATCH 3/8] Fixed a crash with A_ClearOverlays --- src/p_pspr.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 2e285b34a..4d5ab660b 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -1171,50 +1171,39 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ClearOverlays) PARAM_INT_OPT(stop) { stop = 0; } PARAM_BOOL_OPT(safety) { safety = true; } - if (!self->player) + if (self->player == nullptr) ACTION_RETURN_INT(0); - player_t *player = self->player; if (!start && !stop) { start = INT_MIN; stop = safety ? PSP_TARGETCENTER - 1 : INT_MAX; } - int count = 0; - DPSprite *pspr = player->psprites; - int startID = (pspr != nullptr) ? pspr->GetID() : start; - bool first = true; - while (pspr != nullptr) - { - if (pspr->GetID() == startID) - { - if (first) - first = false; - else - break; - } - int id = pspr->GetID(); + unsigned int count = 0; + int id; - //Do not wipe out layer 0. Ever. - if (!id || id < start) + for (DPSprite *pspr = self->player->psprites; pspr != nullptr; pspr = pspr->GetNext()) + { + id = pspr->GetID(); + + if (id < start || id == 0) continue; - if (id > stop) + else if (id > stop) break; if (safety) { if (id >= PSP_TARGETCENTER) break; - else if ((id >= PSP_STRIFEHANDS && id <= PSP_WEAPON) || (id == PSP_FLASH)) + else if (id == PSP_STRIFEHANDS || id == PSP_WEAPON || id == PSP_FLASH) continue; } - // [MC]Don't affect non-hardcoded layers unless it's really desired. pspr->SetState(nullptr); count++; - pspr = pspr->GetNext(); } + ACTION_RETURN_INT(count); } From 446bc1018c86a4a0e08244a148c775cf986e148e Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sat, 16 Jul 2016 15:22:36 +0200 Subject: [PATCH 4/8] Fixed: weapons didn't clear their flash layer when the player died --- src/p_pspr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 4d5ab660b..bad9c2d73 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -1085,9 +1085,8 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower) } if (player->playerstate == PST_DEAD) { // Player is dead, so don't bring up a pending weapon - psp->y = WEAPONBOTTOM; - // Player is dead, so keep the weapon off screen + P_SetPsprite(player, PSP_FLASH, nullptr); psp->SetState(nullptr); return 0; } From 8369833dc5f5cc85781c76fb7ce70ff45cb89d80 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Jul 2016 15:34:57 +0300 Subject: [PATCH 5/8] Fixed setting of custom color for static text in menu --- src/menu/menudef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 6d5e3dd64..1948153e4 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -662,7 +662,7 @@ static EColorRange ParseOptionColor(FScanner &sc, FOptionMenuDescriptor *desc) if (sc.CheckString(",")) { sc.MustGetString(); - EColorRange cr = V_FindFontColor(sc.String); + cr = V_FindFontColor(sc.String); if (cr == CR_UNTRANSLATED && !sc.Compare("untranslated") && isdigit(sc.String[0])) { if (strtol(sc.String, NULL, 0)) cr = OptionSettings.mFontColorHeader; From d4352dd1a75d3a21927961d05d4a9c771ba4cfa1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 17 Jul 2016 23:13:10 +0200 Subject: [PATCH 6/8] - fixed slope calculation error. --- src/r_plane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index d749319e3..ff23492ab 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1677,7 +1677,7 @@ void R_DrawTiltedPlane (visplane_t *pl, double _xscale, double _yscale, fixed_t // the textures a constant size across the surface's plane instead. cosine = cos(planeang), sine = sin(planeang); m[1] = pl->height.ZatPoint(ViewPos.X + yscale * sine, ViewPos.Y + yscale * cosine) - zeroheight; - n[1] = pl->height.ZatPoint(ViewPos.X - xscale * cosine, ViewPos.Y + xscale * sine) - zeroheight; + n[1] = -(pl->height.ZatPoint(ViewPos.X - xscale * cosine, ViewPos.Y + xscale * sine) - zeroheight); plane_su = p ^ m; plane_sv = p ^ n; From d09ec5a930e3e16bb234e4a46a82394300620735 Mon Sep 17 00:00:00 2001 From: Blue-Shadow Date: Tue, 19 Jul 2016 03:16:12 +0300 Subject: [PATCH 7/8] Added DamageType ACS actor property --- src/p_acs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 919834a06..01953cad9 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3719,6 +3719,7 @@ enum APROP_DamageMultiplier=43, APROP_MaxStepHeight = 44, APROP_MaxDropOffHeight= 45, + APROP_DamageType = 46, }; // These are needed for ACS's APROP_RenderStyle @@ -3978,6 +3979,9 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value) actor->MaxDropOffHeight = ACSToDouble(value); break; + case APROP_DamageType: + actor->DamageType = FBehavior::StaticLookupString(value); + break; default: // do nothing. @@ -4081,6 +4085,7 @@ int DLevelScript::GetActorProperty (int tid, int property) case APROP_Friction: return DoubleToACS(actor->Friction); case APROP_MaxStepHeight: return DoubleToACS(actor->MaxStepHeight); case APROP_MaxDropOffHeight: return DoubleToACS(actor->MaxDropOffHeight); + case APROP_DamageType: return GlobalACSStrings.AddString(actor->DamageType); default: return 0; } @@ -4153,6 +4158,7 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value) case APROP_ActiveSound: string = actor->ActiveSound; break; case APROP_Species: string = actor->GetSpecies(); break; case APROP_NameTag: string = actor->GetTag(); break; + case APROP_DamageType: string = actor->DamageType; break; } if (string == NULL) string = ""; return (!stricmp(string, FBehavior::StaticLookupString(value))); From c428e376cd561134a67dedecf462713ff2b82ce1 Mon Sep 17 00:00:00 2001 From: Blue-Shadow Date: Tue, 19 Jul 2016 04:59:07 +0300 Subject: [PATCH 8/8] Added INFLICTORDMGTYPE flag to A_Damage* action functions It forces the use of the inflictor's damagetype instead of whatever is passed to the functions. --- src/thingdef/thingdef_codeptr.cpp | 4 ++++ wadsrc/static/actors/constants.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 63ba6ec30..ef41faea2 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -6129,6 +6129,7 @@ enum DMSS DMSS_EXFILTER = 64, //Changes filter into a blacklisted class instead of whitelisted. DMSS_EXSPECIES = 128, // ^ but with species instead. DMSS_EITHER = 256, //Allow either type or species to be affected. + DMSS_INFLICTORDMGTYPE = 512, //Ignore the passed damagetype and use the inflictor's instead. }; static void DoDamage(AActor *dmgtarget, AActor *inflictor, AActor *source, int amount, FName DamageType, int flags, PClassActor *filter, FName species) @@ -6153,6 +6154,9 @@ static void DoDamage(AActor *dmgtarget, AActor *inflictor, AActor *source, int a if (amount > 0) { //Should wind up passing them through just fine. + if (flags & DMSS_INFLICTORDMGTYPE) + DamageType = inflictor->DamageType; + P_DamageMobj(dmgtarget, inflictor, source, amount, DamageType, dmgFlags); } else if (amount < 0) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 05049e598..ba0d1399d 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -466,6 +466,7 @@ enum DMSS_EXFILTER = 0x00000040, DMSS_EXSPECIES = 0x00000080, DMSS_EITHER = 0x00000100, + DMSS_INFLICTORDMGTYPE = 0x00000200, }; // Flags for A_AlertMonsters