mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 12:23:06 +00:00
better rounding and s int overflow
This commit is contained in:
@@ -30,7 +30,8 @@ bool TickNextTickData::equals(const void *o) const
|
||||
|
||||
int TickNextTickData::hashCode() const
|
||||
{
|
||||
return (((x * 1024 * 1024) + (z * 1024) + y) * 256) + tileId;
|
||||
// 4jcraft added cast to unsigned
|
||||
return ((((unsigned) x * 1024 * 1024) + ((unsigned) z * 1024) + (unsigned) y) * 256) + tileId;
|
||||
}
|
||||
|
||||
TickNextTickData *TickNextTickData::delay(__int64 l)
|
||||
@@ -66,4 +67,4 @@ int TickNextTickData::hash_fnct(const TickNextTickData &k)
|
||||
bool TickNextTickData::eq_test(const TickNextTickData &x, const TickNextTickData &y)
|
||||
{
|
||||
return ( x.x == y.x ) && ( x.y == y.y ) && ( x.z == y.z ) && ( x.tileId == y.tileId );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user