1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

fix restraints with 8 angles (#20197)

This commit is contained in:
spacek531
2023-05-17 11:41:23 -07:00
committed by GitHub
parent 4a79af7b20
commit 4507d3e5c4

View File

@@ -1036,10 +1036,8 @@ static void VehicleSpritePaintRestraints(
PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry)
{
int32_t boundingBoxNum = YawTo16(imageDirection);
auto restraintFrame = ((vehicle->restraints_position - 64) / 64) * 4;
auto spriteNum = (carEntry->SpriteByYaw(imageDirection, SpriteGroupType::RestraintAnimation) + restraintFrame)
* carEntry->base_num_frames
+ carEntry->GroupImageId(SpriteGroupType::RestraintAnimation);
auto restraintFrame = ((vehicle->restraints_position - 64) / 64);
auto spriteNum = carEntry->SpriteOffset(SpriteGroupType::RestraintAnimation, imageDirection, restraintFrame);
vehicle_sprite_paint(session, vehicle, spriteNum, VehicleBoundboxes[carEntry->draw_order][boundingBoxNum], z, carEntry);
}