When opening block select screen, selected block should be at bottom of visible portion of table not top (thanks imjonnyboy). Noclip should not have drag applied when no movement keys are behind held down.

This commit is contained in:
UnknownShadow200 2015-12-21 17:23:36 +11:00
parent 56c146306a
commit 851f430a40
4 changed files with 8 additions and 5 deletions

View File

@ -35,8 +35,7 @@ namespace ClassicalSharp {
}
return true;
}
int scrollY;
int scrollY;
void UpdateScrollY() {
scrollY = selIndex / blocksPerRow;

View File

@ -93,7 +93,8 @@ namespace ClassicalSharp {
RecreateBlockTable();
Block held = game.Inventory.HeldBlock;
selIndex = Array.IndexOf<Block>( blocksTable, held );
UpdateScrollY();
scrollY = (selIndex / blocksPerRow) - (maxRows - 1);
ClampScrollY();
MoveCursorToSelected();
game.Keyboard.KeyRepeat = true;

View File

@ -10,7 +10,10 @@ namespace ClassicalSharp {
bool useLiquidGravity = false; // used by BlockDefinitions.
bool canLiquidJump = true;
void UpdateVelocityYState() {
void UpdateVelocityState( float xMoving, float zMoving ) {
if( noClip && xMoving == 0 && zMoving == 0 )
Velocity = Vector3.Zero;
if( flying || noClip ) {
Velocity.Y = 0; // eliminate the effect of gravity
if( flyingUp || jumping ) {

View File

@ -100,7 +100,7 @@ namespace ClassicalSharp {
lastPitch = nextPitch;
HandleInput( ref xMoving, ref zMoving );
UpdateVelocityYState();
UpdateVelocityState( xMoving, zMoving );
PhysicsTick( xMoving, zMoving );
nextPos = Position;