From 4dd936e438fb868d7115d3fb4e9ebc89b41d3d97 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 13 Apr 2006 22:40:43 +0000 Subject: [PATCH] SVN r43 (trunk) --- docs/rh-log.txt | 14 +++++++++++++- src/d_main.cpp | 3 ++- src/g_level.cpp | 5 +++++ src/g_level.h | 3 ++- src/m_cheat.cpp | 13 ++++++++++++- src/p_lnspec.cpp | 13 +++++++++---- src/p_sectors.cpp | 27 +++++++++++++++++++++++++-- src/s_advsound.cpp | 2 +- wadsrc/sndinfo.txt | 1 + 9 files changed, 70 insertions(+), 11 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f08cc3bec..1b450fac3 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -4,6 +4,17 @@ April 13, 2006 - Update FLAC readers to #define FLAC__NO_DLL to match the new FLAC builds. April 13, 2006 (Changes by Graf Zahl) +- Made weapons/bowhit unlimited. With a limit of 2 it won't be played + consistently. +- Fixed: 'Give' worked for dead players. +- Added checks for sectors without lines to all Find* functions in p_sector.cpp +- Fixed: Dehacked patches weren't loaded when not playing Doom. +- Fixed: Thing_Remove must not remove living players from the map. +- Fixed: Using $MAP in SNDINFO overrides music definitions in MAPINFO. This + made it impossible to define music in MAPINFO for Hexen. +- Fixed: Resurrecting a morphed player must first restore the unmorphed + version. +- Fixed: Resurrect must set the player's weapon to a valid state. - Fixed: The decal stretcher is supposed to stretch the decal to a specifiable size but it used that size as a scaling factor instead. The old code allowed a maximum scaling factor of 4 which masked this bug to a large extent but @@ -25,7 +36,8 @@ April 13, 2006 (Changes by Graf Zahl) * 'monster' lists all monsters and their position. * 'itemd' does the same for items. * 'changesky' changes the sky texture. Useful for trying out different skies. - * 'linetarget' prints some information about the monster the player is aiming at. + * 'linetarget' prints some information about the monster the player is aiming + at. April 12, 2006 - Fixed: Using printinv before starting a game crashed. diff --git a/src/d_main.cpp b/src/d_main.cpp index 6ad5cc72c..daf3c485b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2027,10 +2027,11 @@ void D_DoomMain (void) // [RH] Try adding .deh and .bex files on the command line. // If there are none, try adding any in the config file. - if (gameinfo.gametype == GAME_Doom) + //if (gameinfo.gametype == GAME_Doom) { if (!ConsiderPatches ("-deh", ".deh") && !ConsiderPatches ("-bex", ".bex") && + (gameinfo.gametype == GAME_Doom) && GameConfig->SetSection ("Doom.DefaultDehacked")) { const char *key; diff --git a/src/g_level.cpp b/src/g_level.cpp index 5952677be..8ccacf60a 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -865,6 +865,11 @@ static void ParseMapInfoLower (MapInfoHandler *handlers, } ReplaceString ((char **)(info + handler->data1), sc_String); *((int *)(info + handler->data2)) = colon ? atoi (colon + 1) : 0; + if (levelinfo != NULL) + { + // Flag the level so that the $MAP command doesn't override this. + flags|=LEVEL_MUSICDEFINED; + } } break; diff --git a/src/g_level.h b/src/g_level.h index ca8bf1e39..d45262e6b 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -98,7 +98,8 @@ #define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1 -#define LEVEL_MONSTERFALLINGDAMAGE UCONST64(0x10000000000) +#define LEVEL_MUSICDEFINED UCONST64(0x8000000000) // a marker to disable the $map command in SNDINFO for this map +#define LEVEL_MONSTERFALLINGDAMAGE UCONST64(0x10000000000) struct acsdefered_s; class FBehavior; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index e6753d511..1c71c5e0b 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -273,12 +273,23 @@ void cht_DoCheat (player_t *player, int cheat) if (player->playerstate != PST_LIVE && player->mo != NULL) { player->playerstate = PST_LIVE; + if (player->mo->tracer != NULL) + { + APlayerPawn * pmo = player->mo; + player->mo = (APlayerPawn*)player->mo->tracer; + pmo->Destroy(); + player->mo->player=player; + player->mo->renderflags &= ~RF_INVISIBLE; + player->morphTics = 0; + } player->health = player->mo->health = player->mo->GetDefault()->health; + player->viewheight = player->defaultviewheight; player->mo->flags = player->mo->GetDefault()->flags; player->mo->height = player->mo->GetDefault()->height; player->mo->SetState (player->mo->SpawnState); player->mo->Translation = TRANSLATION(TRANSLATION_Players, BYTE(player-players)); player->mo->GiveDefaultInventory(); + P_SetPsprite(player, ps_weapon, player->ReadyWeapon->UpState); } break; @@ -435,7 +446,7 @@ void cht_Give (player_t *player, char *name, int amount) if (player != &players[consoleplayer]) Printf ("%s is a cheater: give %s\n", player->userinfo.netname, name); - if (player->mo == NULL) + if (player->mo == NULL || player->health <= 0) { return; } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 8433c0a50..0bbed8f22 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1028,10 +1028,15 @@ FUNC(LS_Thing_Remove) while (actor) { AActor *temp = iterator.Next (); - // be friendly to the level statistics! ;) - if (actor->flags&MF_COUNTKILL && actor->health > 0) level.total_monsters--; - if (actor->flags&MF_COUNTITEM) level.total_items--; - actor->Destroy (); + + // Don't remove live players. + if (actor->player == NULL || actor != actor->player->mo) + { + // be friendly to the level statistics! ;) + if (actor->flags&MF_COUNTKILL && actor->health > 0) level.total_monsters--; + if (actor->flags&MF_COUNTITEM) level.total_items--; + actor->Destroy (); + } actor = temp; } diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 2e9405db1..816891c47 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -62,6 +62,8 @@ fixed_t sector_t::FindLowestFloorSurrounding (vertex_t **v) const fixed_t ofloor; vertex_t *spot; + if (linecount == 0) return floortexz; + spot = lines[0]->v1; floor = floorplane.ZatPoint (spot); @@ -104,6 +106,8 @@ fixed_t sector_t::FindHighestFloorSurrounding (vertex_t **v) const fixed_t ofloor; vertex_t *spot; + if (linecount == 0) return floortexz; + spot = lines[0]->v1; floor = FIXED_MIN; @@ -153,6 +157,8 @@ fixed_t sector_t::FindNextHighestFloor (vertex_t **v) const line_t *check; int i; + if (linecount == 0) return floortexz; + spot = lines[0]->v1; height = floorplane.ZatPoint (spot); heightdiff = FIXED_MAX; @@ -206,6 +212,8 @@ fixed_t sector_t::FindNextLowestFloor (vertex_t **v) const line_t *check; int i; + if (linecount == 0) return floortexz; + spot = lines[0]->v1; height = floorplane.ZatPoint (spot); heightdiff = FIXED_MAX; @@ -260,6 +268,9 @@ fixed_t sector_t::FindNextLowestCeiling (vertex_t **v) const line_t *check; int i; + + if (linecount == 0) return ceilingtexz; + spot = lines[0]->v1; height = ceilingplane.ZatPoint (spot); heightdiff = FIXED_MAX; @@ -312,6 +323,8 @@ fixed_t sector_t::FindNextHighestCeiling (vertex_t **v) const line_t *check; int i; + if (linecount == 0) return ceilingtexz; + spot = lines[0]->v1; height = ceilingplane.ZatPoint (spot); heightdiff = FIXED_MAX; @@ -356,6 +369,8 @@ fixed_t sector_t::FindLowestCeilingSurrounding (vertex_t **v) const line_t *check; int i; + if (linecount == 0) return ceilingtexz; + spot = lines[0]->v1; height = FIXED_MAX; @@ -396,6 +411,8 @@ fixed_t sector_t::FindHighestCeilingSurrounding (vertex_t **v) const line_t *check; int i; + if (linecount == 0) return ceilingtexz; + spot = lines[0]->v1; height = FIXED_MIN; @@ -593,7 +610,10 @@ fixed_t sector_t::FindHighestFloorPoint (vertex_t **v) const if ((floorplane.a | floorplane.b) == 0) { if (v != NULL) - *v = lines[0]->v1; + { + if (linecount == 0) *v = &vertexes[0]; + else *v = lines[0]->v1; + } return -floorplane.d; } @@ -632,7 +652,10 @@ fixed_t sector_t::FindLowestCeilingPoint (vertex_t **v) const if ((ceilingplane.a | ceilingplane.b) == 0) { if (v != NULL) - *v = lines[0]->v1; + { + if (linecount == 0) *v = &vertexes[0]; + else *v = lines[0]->v1; + } return ceilingplane.d; } diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 79932573f..e8ca473a4 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -779,7 +779,7 @@ static void S_AddSNDINFO (int lump) sprintf (temp, "MAP%02d", sc_Number); info = FindLevelInfo (temp); SC_MustGetString (); - if (info->mapname[0]) + if (info->mapname[0] && (!(info->flags&LEVEL_MUSICDEFINED))) { ReplaceString (&info->music, sc_String); } diff --git a/wadsrc/sndinfo.txt b/wadsrc/sndinfo.txt index a9b23fd6d..c7ef7e197 100644 --- a/wadsrc/sndinfo.txt +++ b/wadsrc/sndinfo.txt @@ -574,6 +574,7 @@ $limit weapons/phoenixhit 0 $limit weapons/phoenixpowshoot 1 // [RH] Heretic didn't have these limitless, but they can sound bad if they're not +$limit weapons/bowhit 0 $limit weapons/hornrodshoot 0 $limit weapons/hornrodhit 0 $limit weapons/maceshoot 0