mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Mixed signed/unsigned strikes again, causing an incorrect sprite offset for shortened vehicles.
(cherry picked from commit 43aa91a7f5
)
This commit is contained in:
parent
480e03360b
commit
96d4538055
@ -1294,7 +1294,7 @@ int Train::GetDisplayImageWidth(Point *offset) const
|
||||
|
||||
if (offset != nullptr) {
|
||||
if (HasBit(this->flags, VRF_REVERSE_DIRECTION) && !HasBit(EngInfo(this->engine_type)->misc_flags, EF_RAIL_FLIPS)) {
|
||||
offset->x = ScaleSpriteTrad((this->gcache.cached_veh_length - VEHICLE_LENGTH / 2) * reference_width / VEHICLE_LENGTH);
|
||||
offset->x = ScaleSpriteTrad(((int)this->gcache.cached_veh_length - (int)VEHICLE_LENGTH / 2) * reference_width / (int)VEHICLE_LENGTH);
|
||||
} else {
|
||||
offset->x = ScaleSpriteTrad(reference_width) / 2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user