PDA

View Full Version : run speed fix



showeq42
12-14-2016, 06:06 PM
The code is converting the run speed from a float to int then back to float. I fixed that, then divided it by a constant to make base run speed 1.000000
Accurate to 7 significant figures now!



*** src/player.cpp 2016-12-14 15:47:56.914853239 -0800
--- src/player.cpp 2016-07-29 09:41:40.403626326 -0700
***************
*** 905,911 ****
emit changeItem(this, tSpawnChangedPosition);

! emit newSpeed((int)lrint(hypot( hypot( (pupdate->deltaX*80),
(pupdate->deltaY*80)),
! (pupdate->deltaZ*80))));

static uint8_t count = 0;
--- 905,911 ----
emit changeItem(this, tSpawnChangedPosition);

! emit newSpeed(hypot( hypot( (pupdate->deltaX*80),
(pupdate->deltaY*80)),
! (pupdate->deltaZ*80))/119.46664);

static uint8_t count = 0;

*** src/interface.cpp 2016-12-14 15:47:56.953854078 -0800
--- src/interface.cpp 2016-07-29 09:39:37.304384827 -0700
***************
*** 4425,4429 ****

QString tempStr;
! tempStr.sprintf("Run Speed: %3.1f", speed);
m_stsbarSpeed->setText(tempStr);
}
--- 4425,4429 ----

QString tempStr;
! tempStr.sprintf("Run Speed: %3.6f", speed);
m_stsbarSpeed->setText(tempStr);
}

BlueAdept
12-14-2016, 10:59 PM
Awesome. I will incorporate it as soon as I can. I have no days off this week though :( I will try to make time to update.

Spanners
12-16-2016, 07:02 AM
Great stuff, thanks - for info, I included this and Newby's diff from the patch yesterday into showeq-5.13.10.44 and had no issues at all.

Cheers!