Browse Source

Add null pointer checks so Bahro no longer crash release clients

Branan Purvine-Riley 14 years ago
parent
commit
481de14091
  1. 16
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainGeneric.cpp

16
Sources/Plasma/PubUtilLib/plAvatar/plAvBrainGeneric.cpp

@ -413,11 +413,16 @@ hsBool plAvBrainGeneric::IProcessFadeIn(double time, float elapsed)
IEnterMoveMode(time); // if fadeIn's not zero, we have to wait until fade's done IEnterMoveMode(time); // if fadeIn's not zero, we have to wait until fade's done
// before animating // before animating
} else { } else {
curStage->GetAnimInstance()->Fade(1.0f, fFadeIn); plAGAnimInstance *curAnim = curStage->GetAnimInstance();
if(curAnim)
curAnim->Fade(1.0f, fFadeIn);
} }
fMode = kFadingIn; fMode = kFadingIn;
} else { } else {
float curBlend = curStage->GetAnimInstance()->GetBlend(); plAGAnimInstance *curAnim = curStage->GetAnimInstance();
float curBlend = 1.0f;
if(curAnim)
curBlend = curAnim->GetBlend();
if(curBlend == 1.0f) if(curBlend == 1.0f)
{ {
IEnterMoveMode(time); IEnterMoveMode(time);
@ -440,7 +445,7 @@ hsBool plAvBrainGeneric::IProcessFadeOut(double time, float elapsed)
plAGAnimInstance *curAnim = curStage->GetAnimInstance(); plAGAnimInstance *curAnim = curStage->GetAnimInstance();
if(curAnim) if(curAnim)
{ {
curStage->GetAnimInstance()->Fade(0.0f, fFadeOut); curAnim->Fade(0.0f, fFadeOut);
IExitMoveMode(); IExitMoveMode();
fMode = kFadingOut; fMode = kFadingOut;
} else { } else {
@ -454,7 +459,10 @@ hsBool plAvBrainGeneric::IProcessFadeOut(double time, float elapsed)
} }
} else { } else {
// already fading; just keeping looking for the anim to zero out. // already fading; just keeping looking for the anim to zero out.
float curBlend = curStage->GetAnimInstance()->GetBlend(); plAGAnimInstance *curAnim = curStage->GetAnimInstance();
float curBlend = 0.0f;
if(curAnim)
curBlend = curAnim->GetBlend();
if(curBlend == 0.0f) if(curBlend == 0.0f)
{ {
curStage->Detach(fAvMod); curStage->Detach(fAvMod);

Loading…
Cancel
Save