| 170 | } |
| 171 | |
| 172 | void UPVPlayerCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll) |
| 173 | { |
| 174 | auto* UPVItem = &g_Level.Items[itemNumber]; |
| 175 | auto* lara = GetLaraInfo(laraItem); |
| 176 | |
| 177 | if (laraItem->HitPoints <= 0 || lara->Context.Vehicle != NO_VALUE) |
| 178 | return; |
| 179 | |
| 180 | auto mountType = GetVehicleMountType(UPVItem, laraItem, coll, UPVMountTypes, UPV_MOUNT_DISTANCE); |
| 181 | if (mountType == VehicleMountType::None) |
| 182 | { |
| 183 | // HACK: Collision in water behaves differently? @Sezz 2022.06.28 |
| 184 | if (TestBoundsCollide(UPVItem, laraItem, coll->Setup.Radius) && HandleItemSphereCollision(*UPVItem, *laraItem)) |
| 185 | ItemPushItem(UPVItem, laraItem, coll, false, 0); |
| 186 | } |
| 187 | else |
| 188 | { |
| 189 | SetLaraVehicle(laraItem, UPVItem); |
| 190 | DoUPVMount(UPVItem, laraItem, mountType); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | void DoUPVMount(ItemInfo* UPVItem, ItemInfo* laraItem, VehicleMountType mountType) |
| 195 | { |
nothing calls this directly
no test coverage detected