From 322b49ac201f65a53b9eb49a50964b133bcde7f7 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 12 Apr 2012 18:02:39 -0400 Subject: [PATCH] Revert "Fix relto-plunge" This reverts commit 8da276f2e50688691b294438ed3d2bcfa218c617, a commit that did not work as advertised and added too many chances for things to go badly wrong. --- .../plPhysical/plCollisionDetector.cpp | 23 ++++--------------- .../plPhysical/plCollisionDetector.h | 8 ++----- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp index cf03b0b9..57a3648d 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp @@ -73,9 +73,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com plArmatureMod* plCollisionDetector::IGetAvatarModifier(plKey key) { - if (!key) - return nil; - plSceneObject* avObj = plSceneObject::ConvertNoRef(key->ObjectIsLoaded()); if (avObj) { @@ -245,6 +242,8 @@ plCameraRegionDetector::~plCameraRegionDetector() void plCameraRegionDetector::ITrigger(plKey hitter, bool entering, bool immediate) { + if (fSavingSendMsg) + DetectorLogRed("%s: Stale messages on ITrigger. This should never happen!", GetKeyName().c_str()); if (fIsInside && entering) DetectorLogRed("%s: Duplicate enter! Did we miss an exit?", GetKeyName().c_str()); else if (!fIsInside && !entering) @@ -385,18 +384,11 @@ hsBool plObjectInVolumeDetector::MsgReceive(plMessage* msg) plCollideMsg* pCollMsg = plCollideMsg::ConvertNoRef(msg); if (pCollMsg) { - fLastHitter = pCollMsg->fOtherKey; // If the avatar is disabled (flying around), don't trigger - if (IIsDisabledAvatar(fLastHitter)) + if (IIsDisabledAvatar(pCollMsg->fOtherKey)) return false; - ITrigger(fLastHitter, (pCollMsg->fEntering != 0)); - - // If we never eval before the exit... - if (fWaitingForEval) - plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey()); - else - plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey()); - fWaitingForEval = !fWaitingForEval; + ITrigger(pCollMsg->fOtherKey, (pCollMsg->fEntering != 0)); + plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey()); return true; } @@ -404,13 +396,8 @@ hsBool plObjectInVolumeDetector::MsgReceive(plMessage* msg) if (pEvalMsg) { fNumEvals++; - // Don't dispatch if we're not in the age - if (plArmatureMod* av = IGetAvatarModifier(fLastHitter)) - if (av->IsMidLink()) - return true; ISendSavedTriggerMsgs(); plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey()); - fWaitingForEval = false; } plPlayerPageMsg* pageMsg = plPlayerPageMsg::ConvertNoRef(msg); diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h index 623b716a..f2fa65ea 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h +++ b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h @@ -99,19 +99,15 @@ protected: uint32_t fNumEvals; uint32_t fLastEnterEval; uint32_t fLastExitEval; - bool fWaitingForEval; - plKey fLastHitter; public: plObjectInVolumeDetector() - : plCollisionDetector(), fSavedActivatorMsg(nil), fNumEvals(0), fLastEnterEval(0), - fWaitingForEval(false), fLastHitter(nil) + : plCollisionDetector(), fSavedActivatorMsg(nil), fNumEvals(0), fLastEnterEval(0), fLastExitEval(0) { } plObjectInVolumeDetector(int8_t type) - : plCollisionDetector(type), fSavedActivatorMsg(nil), fNumEvals(0), fLastEnterEval(0), - fWaitingForEval(false), fLastHitter(nil) + : plCollisionDetector(type), fSavedActivatorMsg(nil), fNumEvals(0), fLastEnterEval(0), fLastExitEval(0) { } virtual ~plObjectInVolumeDetector() { }