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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

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);
}