mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
This commit is contained in:
parent
fd0528a9b4
commit
341bdabc70
@ -71,7 +71,7 @@ inline DirDiff DirDifference(Direction d0, Direction d1)
|
|||||||
assert(IsValidDirection(d1));
|
assert(IsValidDirection(d1));
|
||||||
/* Cast to uint so compiler can use bitmask. If the difference is negative
|
/* Cast to uint so compiler can use bitmask. If the difference is negative
|
||||||
* and we used int instead of uint, further "+ 8" would have to be added. */
|
* and we used int instead of uint, further "+ 8" would have to be added. */
|
||||||
return static_cast<DirDiff>(static_cast<uint>(d0) - static_cast<uint>(d1) % 8);
|
return static_cast<DirDiff>((static_cast<uint>(d0) - static_cast<uint>(d1)) % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user