mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-06 23:07:13 +00:00
fix: restore ghast reach checks and fire collision bounds after AABB refactor
This commit is contained in:
parent
8cbdb636aa
commit
c12f32f637
|
|
@ -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++;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue