This commit is contained in:
Christoph Oelckers 2016-05-15 23:25:02 +02:00
commit 5e4be101f1
3 changed files with 16 additions and 10 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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);