| 240 | } |
| 241 | |
| 242 | void LaraCollideStop(ItemInfo* item, CollisionInfo* coll) |
| 243 | { |
| 244 | switch (coll->Setup.PrevState) |
| 245 | { |
| 246 | case LS_IDLE: |
| 247 | case LS_TURN_RIGHT_SLOW: |
| 248 | case LS_TURN_LEFT_SLOW: |
| 249 | case LS_TURN_RIGHT_FAST: |
| 250 | case LS_TURN_LEFT_FAST: |
| 251 | item->Animation.AnimObjectID = coll->Setup.PrevAnimObjectID; |
| 252 | item->Animation.AnimNumber = coll->Setup.PrevAnimNumber; |
| 253 | item->Animation.FrameNumber = coll->Setup.PrevFrameNumber; |
| 254 | item->Animation.ActiveState = coll->Setup.PrevState; |
| 255 | |
| 256 | if (IsHeld(In::Left)) |
| 257 | { |
| 258 | // Prevent turn lock against walls. |
| 259 | if (item->Animation.ActiveState == LS_TURN_RIGHT_SLOW || |
| 260 | item->Animation.ActiveState == LS_TURN_RIGHT_FAST) |
| 261 | { |
| 262 | item->Animation.TargetState = LS_IDLE; |
| 263 | } |
| 264 | else |
| 265 | item->Animation.TargetState = LS_TURN_LEFT_SLOW; |
| 266 | } |
| 267 | else if (IsHeld(In::Right)) |
| 268 | { |
| 269 | if (item->Animation.ActiveState == LS_TURN_LEFT_SLOW || |
| 270 | item->Animation.ActiveState == LS_TURN_LEFT_FAST) |
| 271 | { |
| 272 | item->Animation.TargetState = LS_IDLE; |
| 273 | } |
| 274 | else |
| 275 | item->Animation.TargetState = LS_TURN_RIGHT_SLOW; |
| 276 | } |
| 277 | else |
| 278 | item->Animation.TargetState = LS_IDLE; |
| 279 | |
| 280 | AnimateItem(item); |
| 281 | |
| 282 | break; |
| 283 | |
| 284 | default: |
| 285 | item->Animation.TargetState = LS_IDLE; |
| 286 | |
| 287 | if (item->Animation.AnimNumber != LA_STAND_SOLID) |
| 288 | SetAnimation(item, LA_STAND_SOLID); |
| 289 | |
| 290 | break; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | void LaraCollideStopCrawl(ItemInfo* item, CollisionInfo* coll) |
| 295 | { |
no test coverage detected