mirror of
https://github.com/unknownworlds/NS.git
synced 2024-11-22 20:51:36 +00:00
o Setting cl_showspeed to 0 prints the information to the log and resets them.
o Fixed a problem with lerk ascent cap being linked to the direction the lerk was facing instead of moving. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@538 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
aba90b4491
commit
09674543a3
6 changed files with 44 additions and 29 deletions
Binary file not shown.
Binary file not shown.
|
@ -2,7 +2,7 @@
|
|||
// Natural Selection //
|
||||
// by Charlie Cleveland //
|
||||
////////////////////////////
|
||||
game "Natural Selection 3.2 (Revision 537)"
|
||||
game "Natural Selection 3.2 (Revision 538)"
|
||||
url_info "http://www.unknownworlds.com/ns/"
|
||||
url_dl "http://www.unknownworlds.com/ns/view?action=files"
|
||||
icon "ns"
|
||||
|
|
|
@ -2778,37 +2778,47 @@ void AvHHud::Render()
|
|||
|
||||
void AvHHud::RenderCommonUI()
|
||||
{
|
||||
static bool speedMeasured=false;
|
||||
if (!mSteamUIActive)
|
||||
{
|
||||
|
||||
if (gHUD.GetServerVariableFloat("sv_cheats") != 0 && CVAR_GET_FLOAT("cl_showspeed") != 0)
|
||||
{
|
||||
|
||||
// Draw the speedometer.
|
||||
if (gHUD.GetServerVariableFloat("sv_cheats") != 0 ) {
|
||||
static int maxSpeed=0, maxGroundSpeed=0, maxClimb=0, maxDive=0;
|
||||
int theR, theG, theB;
|
||||
this->GetPrimaryHudColor(theR, theG, theB, true, false);
|
||||
if ( CVAR_GET_FLOAT("cl_showspeed") != 0) {
|
||||
|
||||
extern playermove_s* pmove;
|
||||
|
||||
char buffer[1024];
|
||||
// Draw the speedometer.
|
||||
int theR, theG, theB;
|
||||
this->GetPrimaryHudColor(theR, theG, theB, true, false);
|
||||
|
||||
maxClimb=max(maxClimb, (int)pmove->velocity[2]);
|
||||
maxDive=min(maxDive, (int)pmove->velocity[2]);
|
||||
extern playermove_s* pmove;
|
||||
|
||||
char buffer[1024];
|
||||
|
||||
int speed=(int)Length(pmove->velocity);
|
||||
maxClimb=max(maxClimb, (int)pmove->velocity[2]);
|
||||
maxDive=min(maxDive, (int)pmove->velocity[2]);
|
||||
|
||||
maxSpeed=max(speed, maxSpeed);
|
||||
sprintf(buffer, "Speed = %d (%d) %d/%d", speed, maxSpeed, maxClimb, maxDive);
|
||||
mFont.DrawString(10, 10, buffer, theR, theG, theB);
|
||||
int speed=(int)Length(pmove->velocity);
|
||||
|
||||
float theGroundSpeed = sqrtf(pmove->velocity[0] * pmove->velocity[0] + pmove->velocity[1] * pmove->velocity[1]);
|
||||
maxGroundSpeed=max(theGroundSpeed, maxGroundSpeed);
|
||||
sprintf(buffer, "Ground speed = %d (%d)", (int)theGroundSpeed, maxGroundSpeed);
|
||||
mFont.DrawString(10, 12 + mFont.GetStringHeight(), buffer, theR, theG, theB);
|
||||
|
||||
maxSpeed=max(speed, maxSpeed);
|
||||
sprintf(buffer, "Speed = %d (%d) %d/%d", speed, maxSpeed, maxClimb, maxDive);
|
||||
mFont.DrawString(10, 10, buffer, theR, theG, theB);
|
||||
|
||||
}
|
||||
float theGroundSpeed = sqrtf(pmove->velocity[0] * pmove->velocity[0] + pmove->velocity[1] * pmove->velocity[1]);
|
||||
maxGroundSpeed=max(theGroundSpeed, maxGroundSpeed);
|
||||
sprintf(buffer, "Ground speed = %d (%d)", (int)theGroundSpeed, maxGroundSpeed);
|
||||
mFont.DrawString(10, 12 + mFont.GetStringHeight(), buffer, theR, theG, theB);
|
||||
speedMeasured = true;
|
||||
}
|
||||
else if ( speedMeasured == true ) {
|
||||
char msg[256];
|
||||
sprintf(msg, "Current Speed(%d)\tCurrent Ground Speed(%d) Max Speed(%d)\t Max Ground Speed (%d)\tMax Climb (%d)\tMax Dive(%d)\n",
|
||||
(int)Length(pmove->velocity), (int)sqrtf(pmove->velocity[0] * pmove->velocity[0] + pmove->velocity[1] * pmove->velocity[1]),
|
||||
maxSpeed, maxGroundSpeed, maxClimb, maxDive);
|
||||
ConsolePrint(msg);
|
||||
maxSpeed=0, maxGroundSpeed=0, maxClimb=0, maxDive=0;
|
||||
speedMeasured = false;
|
||||
}
|
||||
}
|
||||
|
||||
DrawInfoLocationText();
|
||||
DrawHUDStructureNotification();
|
||||
|
|
|
@ -190,7 +190,7 @@ char* AvHSUGetGameVersionString()
|
|||
string theGameVersionString;
|
||||
|
||||
theGameVersionString = "v" + MakeStringFromInt(BALANCE_VAR(kGameVersionMajor)) + "." + MakeStringFromInt(BALANCE_VAR(kGameVersionMinor)) + "." +
|
||||
MakeStringFromInt(BALANCE_VAR(kGameVersionRevision)) + "-537";
|
||||
MakeStringFromInt(BALANCE_VAR(kGameVersionRevision)) + "-539";
|
||||
|
||||
//memset(theGameVersion, 0, 1024);
|
||||
strcpy(theGameVersion, theGameVersionString.c_str());
|
||||
|
|
|
@ -5219,19 +5219,24 @@ void PM_PreventMegaCrazyLerkPancakage() {
|
|||
|
||||
vec3_t vertical={0,0,-1.0f};
|
||||
|
||||
vec3_t forward;
|
||||
vec3_t tmp;
|
||||
vec3_t normalizedVelocity;
|
||||
|
||||
|
||||
spd = Length( pmove->velocity );
|
||||
|
||||
// pseudo-gravity based on angle of ascent.
|
||||
AngleVectors(pmove->angles, forward, tmp, tmp);
|
||||
float dp=DotProduct(forward, vertical);
|
||||
|
||||
VectorCopy(pmove->velocity, normalizedVelocity);
|
||||
VectorNormalize(normalizedVelocity);
|
||||
float dp=DotProduct(normalizedVelocity, vertical);
|
||||
|
||||
if ( dp > 0 )
|
||||
dp /= 10.0f;
|
||||
else
|
||||
dp /= 5.0f;
|
||||
|
||||
|
||||
// if ( DotProduct(up, pmove->velocity) < 0.0f )
|
||||
// dp *= -1.0f;
|
||||
|
||||
maxbasespeed *= 1.0f + dp;
|
||||
|
||||
if ( spd <= maxbasespeed )
|
||||
|
|
Loading…
Reference in a new issue