| 6237 | } |
| 6238 | |
| 6239 | void Player::unpackUpdate(NetConnection *con, BitStream *stream) |
| 6240 | { |
| 6241 | Parent::unpackUpdate(con,stream); |
| 6242 | |
| 6243 | if (stream->readFlag()) |
| 6244 | mImpactSound = stream->readInt(PlayerData::ImpactBits); |
| 6245 | |
| 6246 | // Server specified action animation |
| 6247 | if (stream->readFlag()) { |
| 6248 | U32 action = stream->readInt(PlayerData::ActionAnimBits); |
| 6249 | bool hold = stream->readFlag(); |
| 6250 | bool atEnd = stream->readFlag(); |
| 6251 | bool fsp = stream->readFlag(); |
| 6252 | |
| 6253 | F32 animPos = -1.0f; |
| 6254 | if (!atEnd && stream->readFlag()) |
| 6255 | animPos = stream->readSignedFloat(6); |
| 6256 | |
| 6257 | if (isProperlyAdded()) { |
| 6258 | setActionThread(action,true,hold,true,fsp); |
| 6259 | bool inDeath = inDeathAnim(); |
| 6260 | if (atEnd) |
| 6261 | { |
| 6262 | mShapeInstance->clearTransition(mActionAnimation.thread); |
| 6263 | mShapeInstance->setPos(mActionAnimation.thread, |
| 6264 | mActionAnimation.forward? 1: 0); |
| 6265 | if (inDeath) |
| 6266 | mDeath.lastPos = 1.0f; |
| 6267 | } |
| 6268 | else if (animPos > 0) { |
| 6269 | mShapeInstance->setPos(mActionAnimation.thread, animPos); |
| 6270 | if (inDeath) |
| 6271 | mDeath.lastPos = animPos; |
| 6272 | } |
| 6273 | |
| 6274 | // mMountPending suppresses tickDelay countdown so players will sit until |
| 6275 | // their mount, or another animation, comes through (or 13 seconds elapses). |
| 6276 | mMountPending = (S32) (inSittingAnim() ? sMountPendingTickWait : 0); |
| 6277 | } |
| 6278 | else { |
| 6279 | mActionAnimation.action = action; |
| 6280 | mActionAnimation.holdAtEnd = hold; |
| 6281 | mActionAnimation.atEnd = atEnd; |
| 6282 | mActionAnimation.firstPerson = fsp; |
| 6283 | } |
| 6284 | } |
| 6285 | |
| 6286 | // Server specified arm animation |
| 6287 | if (stream->readFlag()) { |
| 6288 | U32 action = stream->readInt(PlayerData::ActionAnimBits); |
| 6289 | if (isProperlyAdded()) |
| 6290 | setArmThread(action); |
| 6291 | else |
| 6292 | mArmAnimation.action = action; |
| 6293 | } |
| 6294 | |
| 6295 | // Done if controlled by client ( and not initial update ) |
| 6296 | if(stream->readFlag()) |
nothing calls this directly
no test coverage detected