From a0f507d18f5d04695b66bc35e3412bcf8a82e25e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 09:51:49 +0200 Subject: [PATCH 01/10] - fixed: The crosshair setting code checked for existence of lumps, not textures and missed anything defined in a TEXTURES lump. --- src/g_shared/shared_sbar.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 89921e3a2..2a18801a1 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -146,7 +146,6 @@ void ST_LoadCrosshair(bool alwaysload) { int num = 0; char name[16], size; - int lump; if (!crosshairforce && players[consoleplayer].camera != NULL && @@ -179,18 +178,20 @@ void ST_LoadCrosshair(bool alwaysload) num = -num; } size = (SCREENWIDTH < 640) ? 'S' : 'B'; + mysnprintf (name, countof(name), "XHAIR%c%d", size, num); - if ((lump = Wads.CheckNumForName (name, ns_graphics)) == -1) + FTextureID texid = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly); + if (!texid.isValid()) { mysnprintf (name, countof(name), "XHAIR%c1", size); - if ((lump = Wads.CheckNumForName (name, ns_graphics)) == -1) + texid = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly); + if (!texid.isValid()) { - strcpy (name, "XHAIRS1"); + texid = TexMan.CheckForTexture("XHAIRS1", FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly); } - num = 1; } CrosshairNum = num; - CrosshairImage = TexMan[TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch)]; + CrosshairImage = TexMan[texid]; } //--------------------------------------------------------------------------- From 1e82d72349fa6df6f5a07ee39779c3b361962b3a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 09:56:21 +0200 Subject: [PATCH 02/10] - fixed: G_FinishTravel must clear the MF2_BLASTED flag off the player pawn because this flag will result in damage from contact with other objects in the map. --- src/g_level.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index 69bee5de1..9437ced70 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1169,6 +1169,7 @@ void G_FinishTravel () pawn->lastenemy = NULL; pawn->player->mo = pawn; pawn->player->camera = pawn; + pawn->flags2 &= ~MF2_BLASTED; DObject::StaticPointerSubstitution (oldpawn, pawn); oldpawn->Destroy(); pawndup->Destroy (); From 46ec364443d681fedfdccf89f7cbe8db967f3a91 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 10:08:22 +0200 Subject: [PATCH 03/10] - fixed: When validating the crouch sprite it was assumed that both the regular and the crouch sprite were having full rotations. --- src/p_user.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_user.cpp b/src/p_user.cpp index cd111838d..fbe24cc83 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -629,7 +629,16 @@ void APlayerPawn::BeginPlay () FString crouchspritename = sprites[crouchsprite].name; int spritenorm = Wads.CheckNumForName(normspritename + "A1", ns_sprites); + if (spritenorm==-1) + { + spritenorm = Wads.CheckNumForName(normspritename + "A0", ns_sprites); + } + int spritecrouch = Wads.CheckNumForName(crouchspritename + "A1", ns_sprites); + if (spritecrouch==-1) + { + spritecrouch = Wads.CheckNumForName(crouchspritename + "A0", ns_sprites); + } if (spritenorm==-1 || spritecrouch ==-1) { From 2be3b776d88c79dfc3fecd32e9f9c96dd0d83db1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 10:15:09 +0200 Subject: [PATCH 04/10] - fixed: A_CustomMissile should not jump to the See state for dead monsters when using CMF_CHECKTARGETDEAD. --- src/thingdef/thingdef_codeptr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 048d4d47f..b1c9e9065 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1028,7 +1028,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile) else if (flags & CMF_CHECKTARGETDEAD) { // Target is dead and the attack shall be aborted. - if (self->SeeState != NULL) self->SetState(self->SeeState); + if (self->SeeState != NULL && (self->health > 0 || !(self->flags3 & MF3_ISMONSTER))) self->SetState(self->SeeState); } } From f0e9fde33662a6ab65ca0ed6ec6ef611bb8f4b7d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 10:40:56 +0200 Subject: [PATCH 05/10] - fixed: In Raven games, don't chase after monsters in the titlemap or when actor has a goal. --- src/p_enemy.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index bdc72b0c8..00e2a3dc2 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1600,7 +1600,10 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params) if (!(gameinfo.gametype & (GAME_DoomStrifeChex)) && !multiplayer && - players[0].health <= 0) + players[0].health <= 0 && + actor->goal == NULL && + gamestate != GS_TITLELEVEL + ) { // Single player game and player is dead; look for monsters return P_LookForMonsters (actor); } From 50a829720125a8ee4a865094a075591b3c03e9a4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 11:00:25 +0200 Subject: [PATCH 06/10] - fixed: G_ChangeLevel must resolve warptrans map links before getting the next level's levelinfo. --- src/g_level.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 9437ced70..9671b81cc 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -319,6 +319,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel) bool wantFast; int i; + deathmatch = 1; G_ClearHubInfo(); if (!savegamerestore) { @@ -499,7 +500,9 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill } else if (strncmp(levelname, "enDSeQ", 6) != 0) { - nextinfo = FindLevelInfo (levelname, false); + FString reallevelname = levelname; + CheckWarpTransMap(reallevelname, true); + nextinfo = FindLevelInfo (reallevelname, false); if (nextinfo != NULL) { level_info_t *nextredir = nextinfo->CheckLevelRedirect(); @@ -507,8 +510,12 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill { nextinfo = nextredir; } + nextlevel = nextinfo->MapName; + } + else + { + nextlevel = levelname; } - nextlevel = nextinfo->MapName; } else { From 2ada3fe00eb07330c0a1a15bad4a3a9f51e24463 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 11:40:06 +0200 Subject: [PATCH 07/10] - remove debug stuff. --- src/g_level.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 9671b81cc..d84a48776 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -319,7 +319,6 @@ void G_InitNew (const char *mapname, bool bTitleLevel) bool wantFast; int i; - deathmatch = 1; G_ClearHubInfo(); if (!savegamerestore) { From de68361f27bcfbc4613e5291ed3872f93441f333 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 11:54:19 +0200 Subject: [PATCH 08/10] - fixed: When a sprite is being renamed by Dehacked it also needs to be changed in the list of original sprite names, otherwise any subsequent attempt to use the altered sprite in a frame definition will fail. --- src/d_dehacked.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index e6376a589..d14015ca9 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2154,6 +2154,13 @@ static int PatchText (int oldSize) { strncpy (deh.PlayerSprite, newStr, 4); } + for (unsigned ii = 0; ii < OrgSprNames.Size(); ii++) + { + if (!stricmp(OrgSprNames[ii].c, oldStr)) + { + strcpy(OrgSprNames[ii].c, newStr); + } + } // If this sprite is used by a pickup, then the DehackedPickup sprite map // needs to be updated too. for (i = 0; (size_t)i < countof(DehSpriteMappings); ++i) From f9741f1047468085851bae08370ac40b0f0b3770 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 12:20:06 +0200 Subject: [PATCH 09/10] - added a compatibility option for Hexen's MAP04 to change the z-position of 4 quartz flasks that get lowered into a pool of lava but were incorrectly positioned 48 map units above the floor. --- wadsrc/static/compatibility.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 1c2307ec0..30c54c556 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -198,6 +198,14 @@ E2B5D1400279335811C1C1C0B437D9C8 // Deathknights of the Dark Citadel, map54 clearlineflags 1069 0x200 } +CBDE77E3ACB4B166D53C1812E5C72F54 // Hexen IWAD map04 +{ + setthingz 49 0 + setthingz 50 0 + setthingz 51 0 + setthingz 52 0 +} + 3F249EDD62A3A08F53A6C53CB4C7ABE5 // Artica 3 map01 { clearlinespecial 66 From ee6e87d94bb5de1531d8c0614fa6fd2549ef7132 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Sep 2014 12:38:16 +0200 Subject: [PATCH 10/10] - use a separate counter from AActor::special1 to count weapon use with some Hexen weapons. special1 is used for some other purposes as well, and when using a separate counter it can be reset to 0 when changing weapons, preventing counting errors. --- src/actor.h | 1 + src/g_hexen/a_clericmace.cpp | 2 +- src/g_hexen/a_clericstaff.cpp | 6 +++--- src/g_hexen/a_fighteraxe.cpp | 2 +- src/g_hexen/a_fighterhammer.cpp | 12 ++++++------ src/g_hexen/a_fighterplayer.cpp | 8 ++++---- src/p_mobj.cpp | 4 ++++ src/p_pspr.cpp | 1 + src/version.h | 2 +- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/actor.h b/src/actor.h index 783eb5408..bf4b92457 100644 --- a/src/actor.h +++ b/src/actor.h @@ -857,6 +857,7 @@ public: int special1; // Special info int special2; // Special info + int weaponspecial; // Special info for weapons. int health; BYTE movedir; // 0-7 SBYTE visdir; diff --git a/src/g_hexen/a_clericmace.cpp b/src/g_hexen/a_clericmace.cpp index 0e43f3df9..79b5df340 100644 --- a/src/g_hexen/a_clericmace.cpp +++ b/src/g_hexen/a_clericmace.cpp @@ -56,7 +56,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack) } } // didn't find any creatures, so try to strike any walls - player->mo->special1 = 0; + player->mo->weaponspecial = 0; angle = player->mo->angle; slope = P_AimLineAttack (player->mo, angle, MELEERANGE, &linetarget); diff --git a/src/g_hexen/a_clericstaff.cpp b/src/g_hexen/a_clericstaff.cpp index 36f0c7686..aa8b94d74 100644 --- a/src/g_hexen/a_clericstaff.cpp +++ b/src/g_hexen/a_clericstaff.cpp @@ -164,7 +164,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither) DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink) { - self->special1 = (pr_blink()>>1)+20; + self->weaponspecial = (pr_blink()>>1)+20; } //============================================================================ @@ -177,10 +177,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheckBlink) { if (self->player && self->player->ReadyWeapon) { - if (!--self->special1) + if (!--self->weaponspecial) { P_SetPsprite (self->player, ps_weapon, self->player->ReadyWeapon->FindState ("Blink")); - self->special1 = (pr_blink()+50)>>2; + self->weaponspecial = (pr_blink()+50)>>2; } else { diff --git a/src/g_hexen/a_fighteraxe.cpp b/src/g_hexen/a_fighteraxe.cpp index f80af876b..c1e396810 100644 --- a/src/g_hexen/a_fighteraxe.cpp +++ b/src/g_hexen/a_fighteraxe.cpp @@ -253,7 +253,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack) } } // didn't find any creatures, so try to strike any walls - pmo->special1 = 0; + pmo->weaponspecial = 0; angle = pmo->angle; slope = P_AimLineAttack (pmo, angle, MELEERANGE, &linetarget); diff --git a/src/g_hexen/a_fighterhammer.cpp b/src/g_hexen/a_fighterhammer.cpp index 85bbb3aae..42aae31fb 100644 --- a/src/g_hexen/a_fighterhammer.cpp +++ b/src/g_hexen/a_fighterhammer.cpp @@ -57,7 +57,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack) { P_ThrustMobj (linetarget, angle, power); } - pmo->special1 = false; // Don't throw a hammer + pmo->weaponspecial = false; // Don't throw a hammer goto hammerdone; } } @@ -73,7 +73,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack) { P_ThrustMobj(linetarget, angle, power); } - pmo->special1 = false; // Don't throw a hammer + pmo->weaponspecial = false; // Don't throw a hammer goto hammerdone; } } @@ -83,11 +83,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack) slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, &linetarget, 0, ALF_CHECK3D); if (P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true) != NULL) { - pmo->special1 = false; + pmo->weaponspecial = false; } else { - pmo->special1 = true; + pmo->weaponspecial = true; } hammerdone: // Don't spawn a hammer if the player doesn't have enough mana @@ -95,7 +95,7 @@ hammerdone: !player->ReadyWeapon->CheckAmmo (player->ReadyWeapon->bAltFire ? AWeapon::AltFire : AWeapon::PrimaryFire, false, true)) { - pmo->special1 = false; + pmo->weaponspecial = false; } return; } @@ -116,7 +116,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerThrow) return; } - if (!player->mo->special1) + if (!player->mo->weaponspecial) { return; } diff --git a/src/g_hexen/a_fighterplayer.cpp b/src/g_hexen/a_fighterplayer.cpp index 1b051a608..5df183901 100644 --- a/src/g_hexen/a_fighterplayer.cpp +++ b/src/g_hexen/a_fighterplayer.cpp @@ -66,7 +66,7 @@ static bool TryPunch(APlayerPawn *pmo, angle_t angle, int damage, fixed_t power) slope = P_AimLineAttack (pmo, angle, 2*MELEERANGE, &linetarget); if (linetarget != NULL) { - if (++pmo->special1 >= 3) + if (++pmo->weaponspecial >= 3) { damage <<= 1; power *= 3; @@ -117,9 +117,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack) if (TryPunch(pmo, pmo->angle + i*(ANG45/16), damage, power) || TryPunch(pmo, pmo->angle - i*(ANG45/16), damage, power)) { // hit something - if (pmo->special1 >= 3) + if (pmo->weaponspecial >= 3) { - pmo->special1 = 0; + pmo->weaponspecial = 0; P_SetPsprite (player, ps_weapon, player->ReadyWeapon->FindState ("Fire2")); S_Sound (pmo, CHAN_VOICE, "*fistgrunt", 1, ATTN_NORM); } @@ -127,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack) } } // didn't find any creatures, so try to strike any walls - pmo->special1 = 0; + pmo->weaponspecial = 0; AActor *linetarget; int slope = P_AimLineAttack (pmo, pmo->angle, MELEERANGE, &linetarget); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index cdc511d11..50461c43a 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -206,6 +206,10 @@ void AActor::Serialize (FArchive &arc) { arc << flags7; } + if (SaveVersion >= 4511) + { + arc << weaponspecial; + } arc << special1 << special2 << health diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 49f8bcb84..e477d9751 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -211,6 +211,7 @@ void P_BringUpWeapon (player_t *player) // make sure that the previous weapon's flash state is terminated. // When coming here from a weapon drop it may still be active. P_SetPsprite(player, ps_flash, NULL); + player->mo->weaponspecial = 0; } diff --git a/src/version.h b/src/version.h index af376938c..c8917212d 100644 --- a/src/version.h +++ b/src/version.h @@ -76,7 +76,7 @@ const char *GetVersionString(); // Use 4500 as the base git save version, since it's higher than the // SVN revision ever got. -#define SAVEVER 4511 +#define SAVEVER 4512 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)