MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / runToRopeCB

Function runToRopeCB

src/SB/Game/zNPCTypeBossSandy.cpp:1365–1392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1363}
1364
1365static S32 runToRopeCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*)
1366{
1367 zNPCGoalBossSandyRunToRope* runGoal = (zNPCGoalBossSandyRunToRope*)rawgoal;
1368 zNPCBSandy* sandy = (zNPCBSandy*)runGoal->psyche->clt_owner;
1369 S32 nextgoal = 0;
1370 F32 projection;
1371 xVec3 newPos;
1372
1373 xVec3Sub(&newPos, &sandy->bouncePoint[sandy->fromRope], (xVec3*)&sandy->model->Mat->pos);
1374
1375 newPos.y = 0.0f;
1376 projection = xVec3Dot(&newPos, &sandy->ropeNormal[sandy->fromRope]);
1377
1378 if (globals.player.ControlOff != FALSE)
1379 {
1380 nextgoal = 'NGB1';
1381 *trantype = GOAL_TRAN_SET;
1382 }
1383 else if (projection > 0.0f)
1384 {
1385 nextgoal = 'NGB;';
1386 *trantype = GOAL_TRAN_SET;
1387 sandy->boundFlags[10] &= ~0x10;
1388 sandy->boundFlags[12] &= ~0x10;
1389 }
1390
1391 return nextgoal;
1392}
1393
1394static S32 clotheslineCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*)
1395{

Callers

nothing calls this directly

Calls 1

xVec3SubFunction · 0.85

Tested by

no test coverage detected