Merge pull request #331 from MatthewBeshay/fix/pr329-aabb-followup

fix: restore ghast reach checks and fire collision bounds after AABB refactor
This commit is contained in:
Tropical 2026-03-28 04:46:27 -05:00 committed by GitHub
commit 38ba5e144d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -885,8 +885,8 @@ void Entity::move(double xa, double ya, double za,
checkInsideTiles();
bool water = isInWaterOrRain();
const AABB& shrunk = bb.shrink(0.001, 0.001, 0.001);
if (level->containsFireTile(&bb)) {
AABB shrunk = bb.shrink(0.001, 0.001, 0.001);
if (level->containsFireTile(&shrunk)) {
burn(1);
if (!water) {
onFire++;

View file

@ -169,10 +169,11 @@ bool Ghast::canReach(double xt, double yt, double zt, double dist) {
double xd = (xTarget - x) / dist;
double yd = (yTarget - y) / dist;
double zd = (zTarget - z) / dist;
AABB probe = bb;
for (int d = 1; d < dist; d++) {
bb.move(xd, yd, zd);
if (!level->getCubes(shared_from_this(), &bb)->empty()) return false;
probe = probe.move(xd, yd, zd);
if (!level->getCubes(shared_from_this(), &probe)->empty()) return false;
}
return true;