mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #878 from eightyeight/issue-98
Prevent crash when loading Player with no shape
This commit is contained in:
commit
153d611bcd
1 changed files with 2 additions and 1 deletions
|
|
@ -356,6 +356,7 @@ PlayerData::PlayerData()
|
||||||
decalID = 0;
|
decalID = 0;
|
||||||
decalOffset = 0.0f;
|
decalOffset = 0.0f;
|
||||||
|
|
||||||
|
actionCount = 0;
|
||||||
lookAction = 0;
|
lookAction = 0;
|
||||||
|
|
||||||
// size of bounding box
|
// 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)
|
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;
|
return;
|
||||||
|
|
||||||
if (action >= PlayerData::NumActionAnims)
|
if (action >= PlayerData::NumActionAnims)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue