Browse Source

Prevent crash when loading Player with no shape.

Daniel Buckmaster 11 years ago
parent
commit
a87a891cfc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Engine/source/T3D/player.cpp

+ 2 - 1
Engine/source/T3D/player.cpp

@@ -356,6 +356,7 @@ PlayerData::PlayerData()
    decalID        = 0;
    decalOffset      = 0.0f;
 
+   actionCount = 0;
    lookAction = 0;
 
    // size of bounding box
@@ -3691,7 +3692,7 @@ bool Player::setActionThread(const char* sequence,bool hold,bool wait,bool fsp)
 
 void Player::setActionThread(U32 action,bool forward,bool hold,bool wait,bool fsp, bool forceSet)
 {
-   if (!mDataBlock || (mActionAnimation.action == action && mActionAnimation.forward == forward && !forceSet))
+   if (!mDataBlock || !mDataBlock->actionCount || (mActionAnimation.action == action && mActionAnimation.forward == forward && !forceSet))
       return;
 
    if (action >= PlayerData::NumActionAnims)