| 2262 | } |
| 2263 | |
| 2264 | void Player::setState(ActionState state, U32 recoverTicks) |
| 2265 | { |
| 2266 | if (state != mState) { |
| 2267 | // Skip initialization if there is no manager, the state |
| 2268 | // will get reset when the object is added to a manager. |
| 2269 | if (isProperlyAdded()) { |
| 2270 | switch (state) { |
| 2271 | case RecoverState: { |
| 2272 | if (mDataBlock->landSequenceTime > 0.0f) |
| 2273 | { |
| 2274 | // Use the land sequence as the basis for the recovery |
| 2275 | setActionThread(PlayerData::LandAnim, true, false, true, true); |
| 2276 | F32 timeScale = mShapeInstance->getDuration(mActionAnimation.thread) / mDataBlock->landSequenceTime; |
| 2277 | mShapeInstance->setTimeScale(mActionAnimation.thread,timeScale); |
| 2278 | mRecoverDelay = mDataBlock->landSequenceTime; |
| 2279 | } |
| 2280 | else |
| 2281 | { |
| 2282 | // Legacy recover system |
| 2283 | mRecoverTicks = recoverTicks; |
| 2284 | mReversePending = U32(F32(mRecoverTicks) / sLandReverseScale); |
| 2285 | setActionThread(PlayerData::LandAnim, true, false, true, true); |
| 2286 | } |
| 2287 | break; |
| 2288 | } |
| 2289 | |
| 2290 | default: |
| 2291 | break; |
| 2292 | } |
| 2293 | } |
| 2294 | |
| 2295 | mState = state; |
| 2296 | } |
| 2297 | } |
| 2298 | |
| 2299 | void Player::updateState() |
| 2300 | { |
nothing calls this directly
no test coverage detected