Fix if you were standing above map, and borders height was > map height, you would pick air blocks in the *inside* of the map borders instead of the outside (Thanks Goodly)

This commit is contained in:
UnknownShadow200 2021-03-07 22:15:58 +11:00
parent 3ae1bb5e3b
commit 421d3a7456

View File

@ -167,7 +167,11 @@ static cc_bool RayTrace(struct RayTracer* t, const Vec3* origin, const Vec3* dir
if (origin->X != origin->X || origin->Y != origin->Y || origin->Z != origin->Z) return false;
IVec3_Floor(&pOrigin, origin);
insideMap = World_Contains(pOrigin.X, pOrigin.Y, pOrigin.Z);
/* This used to be World_Contains(pOrigin.X, pOrigin.Y, pOrigin.Z), however */
/* this caused a bug when you were above the map (but still inside the map */
/* horizontally) - if borders height was > map height, you would wrongly */
/* pick blocks on the INSIDE of the map borders instead of OUTSIDE them */
insideMap = World_ContainsXZ(pOrigin.X, pOrigin.Z) && pOrigin.Y >= 0;
reachSq = reach * reach;
for (i = 0; i < 25000; i++) {