From b00360a08c9102289e0d6e1d3e70e9f7f825a3b0 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 13 Apr 2006 03:13:07 +0000 Subject: [PATCH] - Fixed: Using printinv before starting a game crashed. - Fixed: DMover::MovePlane() would not stop moving the plane when it exactly reached its target height unless it was a floor moving down. - Fixed: Actors that can't attack should not be valid haters for Thing_Hate. - Fixed: AArtiBlastRadius::BlastActor() should not set MF2_SLIDE for missiles. - Fixed: sdl/i_input.cpp should check !iscntrl() before generating EV_GUI_Char messages. SVN r36 (trunk) --- docs/rh-log.txt | 9 +- src/dsectoreffect.cpp | 6 +- src/g_hexen/a_blastradius.cpp | 17 +++- src/g_raven/a_minotaur.cpp | 1 - src/g_shared/a_pickups.cpp | 4 + src/p_lnspec.cpp | 162 +++++++++++++++++----------------- src/sdl/i_input.cpp | 3 +- 7 files changed, 114 insertions(+), 88 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 51be3d954..b1ecba57b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,5 +1,12 @@ April 12, 2006 -- Added Jim's Makefile.linux; +- Fixed: Using printinv before starting a game crashed. +- Fixed: DMover::MovePlane() would not stop moving the plane when it exactly + reached its target height unless it was a floor moving down. +- Fixed: Actors that can't attack should not be valid haters for Thing_Hate. +- Fixed: AArtiBlastRadius::BlastActor() should not set MF2_SLIDE for missiles. +- Fixed: sdl/i_input.cpp should check !iscntrl() before generating EV_GUI_Char + messages. +- Added Jim's Makefile.linux. - Changed: Decal scales now use full precision fixed point numbers. - Changed: Keeping impact decals in their own statlist is enough to keep track of them for when one needs to be destroyed. There's no need to maintain a diff --git a/src/dsectoreffect.cpp b/src/dsectoreffect.cpp index 12a928d70..5aa975405 100644 --- a/src/dsectoreffect.cpp +++ b/src/dsectoreffect.cpp @@ -172,7 +172,7 @@ DMover::EResult DMover::MovePlane (fixed_t speed, fixed_t dest, int crush, dest = -m_Sector->ceilingplane.d; } m_Sector->floorplane.ChangeHeight (speed); - if (m_Sector->floorplane.d < dest) + if (m_Sector->floorplane.d <= dest) { m_Sector->floorplane.d = dest; flag = P_ChangeSector (m_Sector, crush, @@ -230,7 +230,7 @@ DMover::EResult DMover::MovePlane (fixed_t speed, fixed_t dest, int crush, dest = -m_Sector->floorplane.d; } m_Sector->ceilingplane.ChangeHeight (-speed); - if (m_Sector->ceilingplane.d < dest) + if (m_Sector->ceilingplane.d <= dest) { m_Sector->ceilingplane.d = dest; flag = P_ChangeSector (m_Sector, crush, @@ -270,7 +270,7 @@ DMover::EResult DMover::MovePlane (fixed_t speed, fixed_t dest, int crush, case 1: // UP m_Sector->ceilingplane.ChangeHeight (speed); - if (m_Sector->ceilingplane.d > dest) + if (m_Sector->ceilingplane.d >= dest) { m_Sector->ceilingplane.d = dest; flag = P_ChangeSector (m_Sector, crush, diff --git a/src/g_hexen/a_blastradius.cpp b/src/g_hexen/a_blastradius.cpp index 4f0d4fb80..3d88dbd0b 100644 --- a/src/g_hexen/a_blastradius.cpp +++ b/src/g_hexen/a_blastradius.cpp @@ -195,8 +195,12 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) if (victim->flags & MF_MISSILE) { - victim->momz = 8*FRACUNIT; - mo->momz = victim->momz; + // [RH] Floor and ceiling huggers should not be blasted vertically. + if (!(victim->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))) + { + victim->momz = 8*FRACUNIT; + mo->momz = victim->momz; + } } else { @@ -208,7 +212,14 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) } else { - victim->flags2 |= MF2_SLIDE | MF2_BLASTED; + if (victim->flags & MF_MISSILE) + { // [RH] Missiles should not slide. + victim->flags2 |= MF2_BLASTED; + } + else + { + victim->flags2 |= MF2_SLIDE | MF2_BLASTED; + } } } } diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index f6c9d46e5..3488e2f27 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -442,7 +442,6 @@ IMPLEMENT_ACTOR (AMinotaurFX3, Raven, -1, 0) PROP_RadiusFixed (8) PROP_HeightFixed (16) PROP_SpeedFixed (0) - PROP_Flags3 (0) PROP_SpawnState (S_MNTRFX3) diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 9320fa165..ebd06ecb2 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -1153,6 +1153,10 @@ CCMD (printinv) { AInventory *item; + if (players[consoleplayer].mo == NULL) + { + return; + } for (item = players[consoleplayer].mo->Inventory; item != NULL; item = item->Inventory) { Printf ("%s #%lu (%d/%d)\n", item->GetClass()->Name+1, item->InventoryID, item->Amount, item->MaxAmount); diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index b15974441..8433c0a50 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1159,96 +1159,100 @@ FUNC(LS_Thing_Hate) } while (hater != NULL) { - // If hating a group of things, record the TID and NULL - // the target (if its TID doesn't match). A_Look will - // find an appropriate thing to go chase after. - if (arg2 != 0) + // Can't hate if can't attack. + if (hater->SeeState != NULL) { - hater->TIDtoHate = arg1; - hater->LastLook.Actor = NULL; - - // If the TID to hate is 0, then don't forget the target and - // lastenemy fields. - if (arg1 != 0) + // If hating a group of things, record the TID and NULL + // the target (if its TID doesn't match). A_Look will + // find an appropriate thing to go chase after. + if (arg2 != 0) { - if (hater->target != NULL && hater->target->tid != arg1) + hater->TIDtoHate = arg1; + hater->LastLook.Actor = NULL; + + // If the TID to hate is 0, then don't forget the target and + // lastenemy fields. + if (arg1 != 0) { - hater->target = NULL; - } - if (hater->lastenemy != NULL && hater->lastenemy->tid != arg1) - { - hater->lastenemy = NULL; + if (hater->target != NULL && hater->target->tid != arg1) + { + hater->target = NULL; + } + if (hater->lastenemy != NULL && hater->lastenemy->tid != arg1) + { + hater->lastenemy = NULL; + } } } - } - // Hate types for arg2: - // - // 0 - Just hate one specific actor - // 1 - Hate actors with given TID and attack players when shot - // 2 - Same as 1, but will go after enemies without seeing them first - // 3 - Hunt actors with given TID and also players - // 4 - Same as 3, but will go after monsters without seeing them first - // 5 - Hate actors with given TID and ignore player attacks - // 6 - Same as 5, but will go after enemies without seeing them first + // Hate types for arg2: + // + // 0 - Just hate one specific actor + // 1 - Hate actors with given TID and attack players when shot + // 2 - Same as 1, but will go after enemies without seeing them first + // 3 - Hunt actors with given TID and also players + // 4 - Same as 3, but will go after monsters without seeing them first + // 5 - Hate actors with given TID and ignore player attacks + // 6 - Same as 5, but will go after enemies without seeing them first - // Note here: If you use Thing_Hate (tid, 0, 2), you can make - // a monster go after a player without seeing him first. - if (arg2 == 2 || arg2 == 4 || arg2 == 6) - { - hater->flags3 |= MF3_NOSIGHTCHECK; - } - else - { - hater->flags3 &= ~MF3_NOSIGHTCHECK; - } - if (arg2 == 3 || arg2 == 4) - { - hater->flags3 |= MF3_HUNTPLAYERS; - } - else - { - hater->flags3 &= ~MF3_HUNTPLAYERS; - } - if (arg2 == 5 || arg2 == 6) - { - hater->flags4 |= MF4_NOHATEPLAYERS; - } - else - { - hater->flags4 &= ~MF4_NOHATEPLAYERS; - } - - if (arg1 == 0) - { - hatee = it; - } - else if (nothingToHate) - { - hatee = NULL; - } - else if (arg2 != 0) - { - do + // Note here: If you use Thing_Hate (tid, 0, 2), you can make + // a monster go after a player without seeing him first. + if (arg2 == 2 || arg2 == 4 || arg2 == 6) { - hatee = hateeIt.Next (); + hater->flags3 |= MF3_NOSIGHTCHECK; } - while ( hatee == NULL || - hatee == hater || // can't hate self - !(hatee->flags & MF_SHOOTABLE) || // can't hate nonshootable things - hatee->health <= 0 || // can't hate dead things - (hatee->flags & MF2_DORMANT)); // can't target dormant things - } - - if (hatee != NULL && hatee != hater && (arg2 == 0 || (hater->goal != NULL && hater->target != hater->goal))) - { - if (hater->target) + else { - hater->lastenemy = hater->target; + hater->flags3 &= ~MF3_NOSIGHTCHECK; } - hater->target = hatee; - if (!(hater->flags2 & MF2_DORMANT)) + if (arg2 == 3 || arg2 == 4) { - hater->SetState (hater->SeeState); + hater->flags3 |= MF3_HUNTPLAYERS; + } + else + { + hater->flags3 &= ~MF3_HUNTPLAYERS; + } + if (arg2 == 5 || arg2 == 6) + { + hater->flags4 |= MF4_NOHATEPLAYERS; + } + else + { + hater->flags4 &= ~MF4_NOHATEPLAYERS; + } + + if (arg1 == 0) + { + hatee = it; + } + else if (nothingToHate) + { + hatee = NULL; + } + else if (arg2 != 0) + { + do + { + hatee = hateeIt.Next (); + } + while ( hatee == NULL || + hatee == hater || // can't hate self + !(hatee->flags & MF_SHOOTABLE) || // can't hate nonshootable things + hatee->health <= 0 || // can't hate dead things + (hatee->flags & MF2_DORMANT)); // can't target dormant things + } + + if (hatee != NULL && hatee != hater && (arg2 == 0 || (hater->goal != NULL && hater->target != hater->goal))) + { + if (hater->target) + { + hater->lastenemy = hater->target; + } + hater->target = hatee; + if (!(hater->flags2 & MF2_DORMANT)) + { + hater->SetState (hater->SeeState); + } } } if (arg0 != 0) diff --git a/src/sdl/i_input.cpp b/src/sdl/i_input.cpp index 2d002b32c..5d3df7f82 100644 --- a/src/sdl/i_input.cpp +++ b/src/sdl/i_input.cpp @@ -1,4 +1,5 @@ #include +#include #include "doomtype.h" #include "c_dispatch.h" #include "doomdef.h" @@ -396,7 +397,7 @@ void MessagePump (const SDL_Event &sev) { D_PostEvent (&event); } - if (event.data2 >= 32 && event.subtype != EV_GUI_KeyUp) + if (!iscntrl(event.data2) && event.subtype != EV_GUI_KeyUp) { event.subtype = EV_GUI_Char; event.data1 = event.data2;