Browse Source

More panic link fixes

Now, we check the armature mod to see if we're REALLY linked in (the screen
is not black). That way, we can be sure all delayed transforms and false
hits (like how we initially spawn into the AhnySphere04 panic region) don't
panic link us.
Adam Johnson 12 years ago
parent
commit
e733ca824b
  1. 19
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  2. 2
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h
  3. 20
      Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp
  4. 3
      Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h

19
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp

@ -650,6 +650,7 @@ void plArmatureMod::IInitDefaults()
fStealthLevel = 0;
fMouseFrameTurnStrength = 0.f;
fSuspendInputCount = 0;
fIsLinkedIn = false;
fMidLink = false;
fAlreadyPanicLinking = false;
fReverseFBOnIdle = false;
@ -1375,16 +1376,21 @@ hsBool plArmatureMod::MsgReceive(plMessage* msg)
plLinkInDoneMsg *doneMsg = plLinkInDoneMsg::ConvertNoRef(msg);
if (doneMsg)
{
fIsLinkedIn = true;
IFireBehaviorNotify(plHBehavior::kBehaviorTypeLinkIn, false);
return true;
}
plAgeLoadedMsg *ageLoadMsg = plAgeLoadedMsg::ConvertNoRef(msg);
if (ageLoadMsg && ageLoadMsg->fLoaded)
if (ageLoadMsg)
{
// only the local player gets these
NetworkSynch(hsTimer::GetSysSeconds(), true);
EnablePhysics(true);
if (ageLoadMsg->fLoaded)
{
// only the local player gets these
NetworkSynch(hsTimer::GetSysSeconds(), true);
EnablePhysics(true);
} else
fIsLinkedIn = false;
return true;
}
@ -2518,6 +2524,11 @@ bool plArmatureMod::IsMidLink()
return fMidLink;
}
bool plArmatureMod::IsLinkedIn()
{
return fIsLinkedIn;
}
hsBool plArmatureMod::ConsumeJump()
{
if (!GetInputFlag(B_CONTROL_CONSUMABLE_JUMP))

2
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h

@ -318,6 +318,7 @@ public:
int GetStealthLevel() const { return fStealthLevel; }
bool IsOpaque();
bool IsLinkedIn();
bool IsMidLink();
hsBool ConsumeJump(); // returns true if the jump keypress was available to consume
@ -401,6 +402,7 @@ protected:
plArmatureUpdateMsg *fUpdateMsg;
// Trying to be a good lad here and align all our bools and bytes...
bool fIsLinkedIn; // We have finished playing the LinkEffects and are properly in the age
bool fMidLink; // We're in between a LeaveAge and an EnterAge
bool fAlreadyPanicLinking; // Cleared when you enter an age. Prevents spamming the server with panic link requests.
bool fUnconsumedJump; // We've pressed the jump key, but haven't jumped yet

20
Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp

@ -928,9 +928,7 @@ void plSubworldRegionDetector::Write(hsStream* stream, hsResMgr* mgr)
///////////////////////////////////
hsBool plPanicLinkRegion::MsgReceive(plMessage* msg)
{
plCollideMsg* pCollMsg = plCollideMsg::ConvertNoRef(msg);
if (pCollMsg)
if (plCollideMsg* pCollMsg = plCollideMsg::ConvertNoRef(msg))
{
if (plNetClientApp::GetInstance()->GetLocalPlayerKey() != pCollMsg->fOtherKey)
return true;
@ -940,13 +938,17 @@ hsBool plPanicLinkRegion::MsgReceive(plMessage* msg)
plArmatureMod* avMod = IGetAvatarModifier(pCollMsg->fOtherKey);
if (avMod)
{
hsPoint3 kinPos;
if (avMod->GetController())
if (avMod->IsLinkedIn())
{
avMod->GetController()->GetKinematicPosition(kinPos);
DetectorLogSpecial("Avatar is panic linking. KinPos at %f,%f,%f and is %s",kinPos.fX,kinPos.fY,kinPos.fZ,avMod->GetController()->IsEnabled() ? "enabled" : "disabled");
}
avMod->PanicLink(fPlayLinkOutAnim);
hsPoint3 kinPos;
if (avMod->GetController())
{
avMod->GetController()->GetKinematicPosition(kinPos);
DetectorLogSpecial("Avatar is panic linking. KinPos at %f,%f,%f and is %s",kinPos.fX,kinPos.fY,kinPos.fZ,avMod->GetController()->IsEnabled() ? "enabled" : "disabled");
}
avMod->PanicLink(fPlayLinkOutAnim);
} else
DetectorLogRed("PANIC LINK %s before we actually linked in!", GetKey()->GetName());
}
}

3
Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h

@ -237,8 +237,7 @@ class plPanicLinkRegion : public plCollisionDetector
public:
hsBool fPlayLinkOutAnim;
plPanicLinkRegion() : fPlayLinkOutAnim(true) {;}
~plPanicLinkRegion(){;}
plPanicLinkRegion() : fPlayLinkOutAnim(true) { }
virtual hsBool MsgReceive(plMessage* msg);

Loading…
Cancel
Save