| 22 | int DebrisFlags; |
| 23 | |
| 24 | void MissileControl(short itemNumber) |
| 25 | { |
| 26 | auto* fx = &EffectList[itemNumber]; |
| 27 | |
| 28 | if (fx->flag1 == 2) |
| 29 | { |
| 30 | fx->pos.Orientation.z += 16 * fx->speed; |
| 31 | |
| 32 | if (fx->speed > 64) |
| 33 | fx->speed -= 4; |
| 34 | |
| 35 | if (fx->pos.Orientation.x > -12288) |
| 36 | { |
| 37 | if (fx->fallspeed < 512) |
| 38 | fx->fallspeed += 36; |
| 39 | fx->pos.Orientation.x -= fx->fallspeed; |
| 40 | } |
| 41 | } |
| 42 | else |
| 43 | { |
| 44 | auto orient = Geometry::GetOrientToPoint( |
| 45 | Vector3(fx->pos.Position.x, fx->pos.Position.y + CLICK(1), fx->pos.Position.z), |
| 46 | LaraItem->Pose.Position.ToVector3()); |
| 47 | |
| 48 | int dh; |
| 49 | if (fx->flag1) |
| 50 | dh = fx->flag1 != 1 ? 768 : 384; |
| 51 | else |
| 52 | { |
| 53 | if (fx->counter) |
| 54 | fx->counter--; |
| 55 | |
| 56 | dh = 256; |
| 57 | } |
| 58 | |
| 59 | if (fx->speed < 192) |
| 60 | { |
| 61 | if (fx->flag1 == 0 || fx->flag1 == 1) |
| 62 | fx->speed++; |
| 63 | |
| 64 | int dy = orient.y - fx->pos.Orientation.y; |
| 65 | if (abs(dy) > abs(ANGLE(180.0f))) |
| 66 | dy = -dy; |
| 67 | dy /= 8; |
| 68 | |
| 69 | int dx = orient.x - fx->pos.Orientation.x; |
| 70 | if (abs(dx) > abs(ANGLE(180.0f))) |
| 71 | dx = -dx; |
| 72 | dx /= 8; |
| 73 | |
| 74 | if (dy <= dh) |
| 75 | { |
| 76 | if (dy < -dh) |
| 77 | dy = -dh; |
| 78 | } |
| 79 | else |
| 80 | dy = dh; |
| 81 |
nothing calls this directly
no test coverage detected