Fix #73
This commit is contained in:
parent
d01acd7978
commit
bfcf96ad13
@ -795,8 +795,13 @@ namespace spades {
|
||||
|
||||
PlayerInput inp = ParsePlayerInput(reader.ReadByte());
|
||||
|
||||
if(GetWorld()->GetLocalPlayer() == p)
|
||||
if(GetWorld()->GetLocalPlayer() == p) {
|
||||
// handle "/fly" jump
|
||||
if(inp.jump) {
|
||||
p->ForceJump();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
p->SetInput(inp);
|
||||
}
|
||||
|
@ -1143,6 +1143,15 @@ namespace spades {
|
||||
return ((velocity.z >= 0.f && velocity.z < .017f) && !airborne);
|
||||
}
|
||||
|
||||
void Player::ForceJump() {
|
||||
velocity.z = -0.36f;
|
||||
lastJump = true;
|
||||
if(world->GetListener() && world->GetTime() > lastJumpTime + .1f){
|
||||
world->GetListener()->PlayerJumped(this);
|
||||
lastJumpTime = world->GetTime();
|
||||
}
|
||||
}
|
||||
|
||||
void Player::MovePlayer(float fsynctics) {
|
||||
if(input.jump && (!lastJump) &&
|
||||
IsOnGroundOrWade()) {
|
||||
|
@ -164,6 +164,7 @@ namespace spades {
|
||||
void SetWeaponInput(WeaponInput);
|
||||
void SetTool(ToolType);
|
||||
void SetHeldBlockColor(IntVector3);
|
||||
void ForceJump();
|
||||
bool IsBlockCursorActive();
|
||||
bool IsBlockCursorDragging();
|
||||
IntVector3 GetBlockCursorPos(){return blockCursorPos;}
|
||||
|
Loading…
x
Reference in New Issue
Block a user