| 6386 | } |
| 6387 | |
| 6388 | void Player::unpackUpdate(NetConnection *con, BitStream *stream) |
| 6389 | { |
| 6390 | Parent::unpackUpdate(con,stream); |
| 6391 | |
| 6392 | if (stream->readFlag()) |
| 6393 | mImpactSound = stream->readInt(PlayerData::ImpactBits); |
| 6394 | |
| 6395 | // Server specified action animation |
| 6396 | if (stream->readFlag()) { |
| 6397 | U32 action = stream->readInt(PlayerData::ActionAnimBits); |
| 6398 | bool hold = stream->readFlag(); |
| 6399 | bool atEnd = stream->readFlag(); |
| 6400 | bool fsp = stream->readFlag(); |
| 6401 | |
| 6402 | F32 animPos = -1.0f; |
| 6403 | if (!atEnd && stream->readFlag()) |
| 6404 | animPos = stream->readSignedFloat(6); |
| 6405 | |
| 6406 | if (isProperlyAdded()) { |
| 6407 | setActionThread(action,true,hold,true,fsp); |
| 6408 | bool inDeath = inDeathAnim(); |
| 6409 | if (atEnd) |
| 6410 | { |
| 6411 | mShapeInstance->clearTransition(mActionAnimation.thread); |
| 6412 | mShapeInstance->setPos(mActionAnimation.thread, |
| 6413 | mActionAnimation.forward? 1: 0); |
| 6414 | if (inDeath) |
| 6415 | mDeath.lastPos = 1.0f; |
| 6416 | } |
| 6417 | else if (animPos > 0) { |
| 6418 | mShapeInstance->setPos(mActionAnimation.thread, animPos); |
| 6419 | if (inDeath) |
| 6420 | mDeath.lastPos = animPos; |
| 6421 | } |
| 6422 | |
| 6423 | // mMountPending suppresses tickDelay countdown so players will sit until |
| 6424 | // their mount, or another animation, comes through (or 13 seconds elapses). |
| 6425 | mMountPending = (S32) (inSittingAnim() ? sMountPendingTickWait : 0); |
| 6426 | } |
| 6427 | else { |
| 6428 | mActionAnimation.action = action; |
| 6429 | mActionAnimation.holdAtEnd = hold; |
| 6430 | mActionAnimation.atEnd = atEnd; |
| 6431 | mActionAnimation.firstPerson = fsp; |
| 6432 | } |
| 6433 | } |
| 6434 | |
| 6435 | // Server specified arm animation |
| 6436 | if (stream->readFlag()) { |
| 6437 | U32 action = stream->readInt(PlayerData::ActionAnimBits); |
| 6438 | if (isProperlyAdded()) |
| 6439 | setArmThread(action); |
| 6440 | else |
| 6441 | mArmAnimation.action = action; |
| 6442 | } |
| 6443 | |
| 6444 | afx_unpackUpdate(con, stream); |
| 6445 | // Done if controlled by client ( and not initial update ) |
nothing calls this directly
no test coverage detected