diff --git a/src/g_strife/a_strifeitems.cpp b/src/g_strife/a_strifeitems.cpp index 45e8218e1..26ac88393 100644 --- a/src/g_strife/a_strifeitems.cpp +++ b/src/g_strife/a_strifeitems.cpp @@ -188,10 +188,13 @@ bool ARaiseAlarm::TryPickup (AActor *&toucher) bool ARaiseAlarm::SpecialDropAction (AActor *dropper) { - P_NoiseAlert (dropper->target, dropper->target); - if (dropper->target->CheckLocalView (consoleplayer)) + if (dropper->target != nullptr) { - Printf ("You Fool! You've set off the alarm.\n"); + P_NoiseAlert(dropper->target, dropper->target); + if (dropper->target->CheckLocalView(consoleplayer)) + { + Printf("You Fool! You've set off the alarm.\n"); + } } Destroy (); return true; @@ -237,11 +240,14 @@ bool ACloseDoor222::TryPickup (AActor *&toucher) bool ACloseDoor222::SpecialDropAction (AActor *dropper) { EV_DoDoor (DDoor::doorClose, NULL, dropper, 222, 2., 0, 0, 0); - if (dropper->target->CheckLocalView (consoleplayer)) + if (dropper->target != nullptr) { - Printf ("You're dead! You set off the alarm.\n"); + if (dropper->target->CheckLocalView(consoleplayer)) + { + Printf("You're dead! You set off the alarm.\n"); + } + P_NoiseAlert(dropper->target, dropper->target); } - P_NoiseAlert (dropper->target, dropper->target); Destroy (); return true; } diff --git a/src/p_map.cpp b/src/p_map.cpp index 22004b897..8fd274437 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1140,7 +1140,7 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch DVector3 oldpos = tm.thing->PosRelative(thing); // Both actors already overlap. To prevent them from remaining stuck allow the move if it // takes them further apart or the move does not change the position (when called from P_ChangeSector.) - if (oldpos.X == thing->X() && oldpos.Y == thing->Y()) + if (tm.pos.X == tm.thing->X() && tm.pos.Y == tm.thing->Y()) { unblocking = true; } @@ -5487,7 +5487,7 @@ void P_FindAboveIntersectors(AActor *actor) // not what is wanted here. continue; } - if (thing->Z() >= actor->Z() && + if (thing->Z() > actor->Z() && thing->Z() <= actor->Top()) { // Thing intersects above the base intersectors.Push(thing); diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 552889c48..5fa8aa2f2 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -459,6 +459,8 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector) P_CollectConnectedGroups(Sector->PortalGroup, Pos(), Top(), radius, check); + BlockNode = NULL; + FBlockNode **alink = &this->BlockNode; for (int i = -1; i < (int)check.Size(); i++) { DVector3 pos = i==-1? Pos() : PosRelative(check[i] & ~FPortalGroupArray::FLAT); @@ -470,11 +472,9 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector) if (x1 >= bmapwidth || x2 < 0 || y1 >= bmapheight || y2 < 0) { // thing is off the map - BlockNode = NULL; } else { // [RH] Link into every block this actor touches, not just the center one - FBlockNode **alink = &this->BlockNode; x1 = MAX(0, x1); y1 = MAX(0, y1); x2 = MIN(bmapwidth - 1, x2);