Simple Parts Pack for Flan's Mod

Simple Parts Pack for Flan's Mod

903k Downloads

Server crash when entering a vehicle while holding mouse clicked

blooditor opened this issue ยท 7 comments

commented

Hey,
the server/integrated server crashes on MC 1.8 5.3.1 when a player enters a vehicle and holding the right mouse button at the same time (so if you want to enter a vehicle and hold the mouse button a bit too long). The singleplayer freezes and the multiplayer server times out.
I couldn't find the exact cause of the problem, only that the vehicle want's to shoot something because the mouse button is clicked and something goes wrong (Error and not Exception somehow).

Because of the freeze there is no crash recognized most of the time. There is one I could find:

java.lang.Error at com.flansmod.common.vector.Matrix4f.rotate(Matrix4f.java:520) at com.flansmod.common.vector.Matrix4f.rotate(Matrix4f.java:509) at com.flansmod.common.RotatedAxes.findLocalVectorGlobally(RotatedAxes.java:186) at com.flansmod.common.driveables.EntityDriveable.rotate(EntityDriveable.java:1112) at com.flansmod.common.driveables.EntityDriveable.getOrigin(EntityDriveable.java:733) at com.flansmod.common.driveables.EntityDriveable.shootEach(EntityDriveable.java:535) at com.flansmod.common.driveables.EntityDriveable.shoot(EntityDriveable.java:516) at com.flansmod.common.driveables.EntityDriveable.onUpdate(EntityDriveable.java:950) at com.flansmod.common.driveables.EntityPlane.onUpdate(EntityPlane.java:316) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2031) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:758) at net.minecraft.world.World.updateEntity(World.java:1997) at net.minecraft.world.World.updateEntities(World.java:1823) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:587) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:775) at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:385) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540) at java.lang.Thread.run(Unknown Source)

I was able to bypass the error by adding one thing in onUpdate() line 916 of EntityVehicle:
if(rightMouseHeld && getDriveableType().modeSecondary == EnumFireMode.FULLAUTO)

//added bypass so it can't call the shoot if the vehicle is not running, needs something better here:

if(throttle > 0)
shoot(true);

commented

Have the same issue also with your litte bypass
java.lang.Error is realy unspezific .(

commented

Will anyone fix this?

commented

Its really weird, also happens in some other cases I couldn't reproduce yet

commented

Looks like I found the issue.
It's in EntityDriveable#shoot()
The loop while(getShootDelay(secondary) <= 0.0f)
causes an infinite loop and crashes the game.
Looks like you can simply fix that by replacing while(...) with if(...)

commented

Couldn't reproduce in latest version

commented
commented