Merge branch '1.7.x' of https://github.com/squeek502/Squake into 1.8

# Conflicts:
#	java/squeek/quakemovement/QuakeClientPlayer.java
This commit is contained in:
Ryan Liptak 2017-11-29 00:33:17 -08:00
commit b5fcb1f09f

View File

@ -102,7 +102,7 @@ public class QuakeClientPlayer extends ClientPlayerBase
@Override @Override
public void moveFlying(float sidemove, float forwardmove, float wishspeed) public void moveFlying(float sidemove, float forwardmove, float wishspeed)
{ {
if ((this.player.capabilities.isFlying && this.player.ridingEntity == null) || this.player.isInWater() || this.player.isInLava()) if ((this.player.capabilities.isFlying && this.player.ridingEntity == null) || this.player.isInWater() || this.player.isInLava() || this.player.isOnLadder())
{ {
super.moveFlying(sidemove, forwardmove, wishspeed); super.moveFlying(sidemove, forwardmove, wishspeed);
return; return;
@ -422,6 +422,12 @@ public class QuakeClientPlayer extends ClientPlayerBase
*/ */
public void quake_moveEntityWithHeading(float sidemove, float forwardmove) public void quake_moveEntityWithHeading(float sidemove, float forwardmove)
{ {
// take care of ladder movement using default code
if (this.player.isOnLadder())
{
super.moveEntityWithHeading(sidemove, forwardmove);
return;
}
// take care of lava movement using default code // take care of lava movement using default code
if ((this.player.isInLava() && !this.player.capabilities.isFlying)) if ((this.player.isInLava() && !this.player.capabilities.isFlying))
{ {
@ -490,15 +496,9 @@ public class QuakeClientPlayer extends ClientPlayerBase
} }
} }
// make adjustments for ladder interaction
minecraft_ApplyLadderPhysics();
// apply velocity // apply velocity
this.player.moveEntity(this.player.motionX, this.player.motionY, this.player.motionZ); this.player.moveEntity(this.player.motionX, this.player.motionY, this.player.motionZ);
// climb ladder here for some reason
minecraft_ClimbLadder();
// HL2 code applies half gravity before acceleration and half after acceleration, but this seems to work fine // HL2 code applies half gravity before acceleration and half after acceleration, but this seems to work fine
minecraft_ApplyGravity(); minecraft_ApplyGravity();
} }