MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / LaraCollideStop

Function LaraCollideStop

TombEngine/Game/Lara/lara_collide.cpp:242–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void 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
294void LaraCollideStopCrawl(ItemInfo* item, CollisionInfo* coll)
295{

Callers 8

lara_col_walk_forwardFunction · 0.85
lara_col_run_forwardFunction · 0.85
lara_col_run_backFunction · 0.85
lara_col_walk_backFunction · 0.85
lara_col_step_rightFunction · 0.85
lara_col_step_leftFunction · 0.85
lara_col_wade_forwardFunction · 0.85
lara_col_sprintFunction · 0.85

Calls 3

IsHeldFunction · 0.85
AnimateItemFunction · 0.85
SetAnimationFunction · 0.85

Tested by

no test coverage detected