Changeset - r28101:7e6c6e389710
[Not reviewed]
master
0 1 0
Peter Nelson - 13 months ago 2023-11-05 20:09:11
peter1138@openttd.org
Fix #11437: Flipped shorter rail vehicles disappear in windows. (#11446)

Mixed signed/unsigned strikes again, causing an incorrect sprite offset for shortened vehicles.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -469,7 +469,7 @@ int Train::GetDisplayImageWidth(Point *o
 

	
 
	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;
 
		}
0 comments (0 inline, 0 general)