Skip to content

Commit

Permalink
Fix pushing/moving players
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Aug 1, 2018
1 parent cf56679 commit 8ae9b21
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public void onUpdate() {
}

if (this.getCurrentSpeed().metric() > 1) {
List<Entity> entitiesWithin = world.getEntitiesWithinAABB(EntityLiving.class, this.getCollisionBoundingBox().offset(0, -0.5, 0));
List<Entity> entitiesWithin = world.getEntitiesWithinAABB(EntityLivingBase.class, this.getCollisionBoundingBox().offset(0, -0.5, 0));
for (Entity entity : entitiesWithin) {
if (entity instanceof EntityMoveableRollingStock) {
// rolling stock collisions handled by looking at the front and
Expand All @@ -369,10 +369,6 @@ public void onUpdate() {
// Don't apply bb to passengers
continue;
}

if (! (entity instanceof EntityLivingBase)) {
continue;
}

if (entity instanceof EntityPlayer) {
if (entity.ticksExisted < 20 * 5) {
Expand Down Expand Up @@ -406,18 +402,14 @@ public void onUpdate() {
// Riding on top of cars
AxisAlignedBB bb = this.getCollisionBoundingBox();
bb = bb.offset(0, gauge.scale()*2, 0);
List<Entity> entitiesAbove = world.getEntitiesWithinAABB(EntityLiving.class, bb);
List<Entity> entitiesAbove = world.getEntitiesWithinAABB(EntityLivingBase.class, bb);
for (Entity entity : entitiesAbove) {
if (entity instanceof EntityMoveableRollingStock) {
continue;
}
if (entity.getRidingEntity() instanceof EntityMoveableRollingStock) {
continue;
}

if (! (entity instanceof EntityLivingBase)) {
continue;
}

// Chunk.getEntitiesOfTypeWithinAABB() does a reverse aabb intersect
// We need to do a forward lookup
Expand Down

0 comments on commit 8ae9b21

Please sign in to comment.