From ca454bfeb3fe6ca5f0054b7e27f6301bd3d10098 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 19 Mar 2009 11:24:14 +0000 Subject: [PATCH] - Fixed: P_FindFloorCeiling may not call P_PointInSector if called from P_SpawnMapThing. It must use the values the actor has been initialized to by LinkToWorldForMapThing. SVN r1488 (trunk) --- docs/rh-log.txt | 7 ++++++- src/p_map.cpp | 32 ++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index db98c7102..8c0bf027a 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,9 @@ -March 17, 2009 +March 18, 2009 (Changes by Graf Zahl) +- Fixed: P_FindFloorCeiling may not call P_PointInSector if called from + P_SpawnMapThing. It must use the values the actor has been initialized to + by LinkToWorldForMapThing. + +March 17, 2009 - Added the -norun parameter to quit the game just before video initialization. To be used to check for errors in scripts without actually running the game. diff --git a/src/p_map.cpp b/src/p_map.cpp index f0e9add9e..5cadec583 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -214,15 +214,27 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos) tmf.x = actor->x; tmf.y = actor->y; tmf.z = actor->z; - P_GetFloorCeilingZ(tmf); - actor->floorz = tmf.floorz; - actor->dropoffz = tmf.dropoffz; - actor->ceilingz = tmf.ceilingz; - actor->floorpic = tmf.floorpic; - actor->floorsector = tmf.floorsector; - actor->ceilingpic = tmf.ceilingpic; - actor->ceilingsector = tmf.ceilingsector; + if (!onlyspawnpos) + { + P_GetFloorCeilingZ(tmf); + actor->floorz = tmf.floorz; + actor->dropoffz = tmf.dropoffz; + actor->ceilingz = tmf.ceilingz; + actor->floorpic = tmf.floorpic; + actor->floorsector = tmf.floorsector; + actor->ceilingpic = tmf.ceilingpic; + actor->ceilingsector = tmf.ceilingsector; + } + else + { + tmf.ceilingsector = tmf.floorsector = actor->Sector; + + tmf.floorz = tmf.dropoffz = actor->floorz; + tmf.ceilingz = actor->ceilingz; + tmf.floorpic = actor->floorpic; + tmf.ceilingpic = actor->ceilingpic; + } FBoundingBox box(tmf.x, tmf.y, actor->radius); @@ -249,6 +261,10 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos) actor->ceilingpic = tmf.ceilingpic; actor->ceilingsector = tmf.ceilingsector; } + else + { + actor->floorsector = actor->ceilingsector = actor->Sector; + } } //