- made forwardmove and sidemove defaults configurable through the gameinfo section.

This commit is contained in:
Christoph Oelckers 2019-01-05 08:48:57 +01:00
commit bfbf7ff9c9
8 changed files with 114 additions and 86 deletions

View file

@ -71,6 +71,7 @@
#include "serializer.h"
#include "vm.h"
#include "dobjgc.h"
#include "gi.h"
#include "g_hub.h"
#include "g_levellocals.h"
@ -181,8 +182,6 @@ short consistancy[MAXPLAYERS][BACKUPTICS];
#define TURBOTHRESHOLD 12800
float normforwardmove[2] = {0x19, 0x32}; // [RH] For setting turbo from console
float normsidemove[2] = {0x18, 0x28}; // [RH] Ditto
int forwardmove[2], sidemove[2];
int angleturn[4] = {640, 1280, 320, 320}; // + slow turn
@ -224,7 +223,7 @@ EXTERN_CVAR (Int, team)
CVAR (Bool, teamplay, false, CVAR_SERVERINFO)
// [RH] Allow turbo setting anytime during game
CUSTOM_CVAR (Float, turbo, 100.f, 0)
CUSTOM_CVAR (Float, turbo, 100.f, CVAR_NOINITCALL)
{
if (self < 10.f)
{
@ -238,10 +237,10 @@ CUSTOM_CVAR (Float, turbo, 100.f, 0)
{
double scale = self * 0.01;
forwardmove[0] = (int)(normforwardmove[0]*scale);
forwardmove[1] = (int)(normforwardmove[1]*scale);
sidemove[0] = (int)(normsidemove[0]*scale);
sidemove[1] = (int)(normsidemove[1]*scale);
forwardmove[0] = (int)(gameinfo.normforwardmove[0]*scale);
forwardmove[1] = (int)(gameinfo.normforwardmove[1]*scale);
sidemove[0] = (int)(gameinfo.normsidemove[0]*scale);
sidemove[1] = (int)(gameinfo.normsidemove[1]*scale);
}
}