parent
be96c43b4b
commit
c05119a2da
@ -279,13 +279,9 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|||||||
tCarPhysics *phys=(tCarPhysics*)entity->physics;
|
tCarPhysics *phys=(tCarPhysics*)entity->physics;
|
||||||
tCarDefinition *car=&(phys->car);
|
tCarDefinition *car=&(phys->car);
|
||||||
|
|
||||||
int isValid=true;
|
|
||||||
float velo=~entity->velo;
|
float velo=~entity->velo;
|
||||||
float driveSlip=0,slip=0,angularVelo=0;
|
float driveSlip=0,slip=0,angularVelo=0;
|
||||||
int wheelsOnGround=0;
|
int wheelsOnGround=0;
|
||||||
int valid=true;
|
|
||||||
if((car->demoAvailable-car->numColors!=1)&&(entity==gCarEntities[gGameInfo->playerID]))
|
|
||||||
isValid=false;
|
|
||||||
|
|
||||||
for(int i=0;i<car->numWheels;i++)
|
for(int i=0;i<car->numWheels;i++)
|
||||||
{
|
{
|
||||||
@ -297,8 +293,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|||||||
}
|
}
|
||||||
angularVelo+=phys->wheels[i].angularVelo*car->wheels[i].powered;
|
angularVelo+=phys->wheels[i].angularVelo*car->wheels[i].powered;
|
||||||
}
|
}
|
||||||
if((gMapInfo->demoAvailable+gMapInfo->numObjs))
|
|
||||||
isValid=false;
|
|
||||||
|
|
||||||
if(wheelsOnGround)
|
if(wheelsOnGround)
|
||||||
slip/=wheelsOnGround;
|
slip/=wheelsOnGround;
|
||||||
@ -307,10 +301,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|||||||
CalcThrottleBrake(car,phys,driveSlip,angularVelo,velo,slip);
|
CalcThrottleBrake(car,phys,driveSlip,angularVelo,velo,slip);
|
||||||
CalcSteering(entity,car,phys,velo);
|
CalcSteering(entity,car,phys,velo);
|
||||||
|
|
||||||
if(!isValid)
|
|
||||||
if(entity->regData)
|
|
||||||
qRT3_LicenseTestApp2(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid);
|
|
||||||
|
|
||||||
if(GetButtonInput(kInputHandbrakeButton))
|
if(GetButtonInput(kInputHandbrakeButton))
|
||||||
phys->handbrake+=kFrameTime*(1/kHandbrakeTime);
|
phys->handbrake+=kFrameTime*(1/kHandbrakeTime);
|
||||||
else
|
else
|
||||||
@ -320,10 +310,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|||||||
else if(phys->handbrake<0)
|
else if(phys->handbrake<0)
|
||||||
phys->handbrake=0;
|
phys->handbrake=0;
|
||||||
|
|
||||||
if(!isValid)
|
|
||||||
if(entity->regData)
|
|
||||||
qRT3_LicenseTestBlock2(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid);
|
|
||||||
|
|
||||||
if(gFrameCount*kFrameTime>=kStartGameDelaySeconds)
|
if(gFrameCount*kFrameTime>=kStartGameDelaySeconds)
|
||||||
{
|
{
|
||||||
if(gConfig->automatic)
|
if(gConfig->automatic)
|
||||||
@ -415,31 +401,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|||||||
phys->throttle=0.7;
|
phys->throttle=0.7;
|
||||||
else
|
else
|
||||||
phys->throttle=phys->idleThrottle;
|
phys->throttle=phys->idleThrottle;
|
||||||
if(entity==gViewedEntity)
|
|
||||||
{
|
|
||||||
int invalid=false;
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_CODE_01,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_CODE_02,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_03,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_04,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_05,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_06,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_07,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_08,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_09,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_10,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_11,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_12,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_13,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_14,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_15,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_16,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_17,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_18,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_19,invalid);
|
|
||||||
if(!invalid)qRT3_LicenseIsSameCode(phys->regCode,RT3_PIRATED_FAKE_20,invalid);
|
|
||||||
valid=!invalid;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(phys->rpm<car->clutchRPM)
|
if(phys->rpm<car->clutchRPM)
|
||||||
@ -451,19 +412,11 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|||||||
phys->clutch=0;
|
phys->clutch=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isValid)
|
|
||||||
if(gFrameCount>kFPS*30)
|
|
||||||
phys->throttle=0;
|
|
||||||
|
|
||||||
if(GetButtonInput(kInputHorn))
|
if(GetButtonInput(kInputHorn))
|
||||||
phys->lightFlags|=kLightFlagHorn;
|
phys->lightFlags|=kLightFlagHorn;
|
||||||
else
|
else
|
||||||
phys->lightFlags&=~kLightFlagHorn;
|
phys->lightFlags&=~kLightFlagHorn;
|
||||||
|
|
||||||
if(!valid)
|
|
||||||
if(RandomProb(kFrameTime/car->gearSwitchTime*7))
|
|
||||||
phys->gear=0;
|
|
||||||
|
|
||||||
if(GetButtonInput(kInputLeftIndicator))
|
if(GetButtonInput(kInputLeftIndicator))
|
||||||
phys->lightFlags|=kLightFlagLIndLight;
|
phys->lightFlags|=kLightFlagLIndLight;
|
||||||
else if(GetButtonInput(kInputRightIndicator))
|
else if(GetButtonInput(kInputRightIndicator))
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
#include "localtracker.h"
|
#include "localtracker.h"
|
||||||
#include "writeout.h"
|
#include "writeout.h"
|
||||||
#include "interfacemultiplayer.h"
|
#include "interfacemultiplayer.h"
|
||||||
#include "reg_tool_3.h"
|
|
||||||
#include "rt3_redline.h"
|
|
||||||
#undef MemoryMove
|
#undef MemoryMove
|
||||||
#include "gamemem.h"
|
#include "gamemem.h"
|
||||||
|
|
||||||
|
@ -167,9 +167,6 @@ float CalcSlipAngle(tVector3 wheelVelo,tVector3 wheelDir,tVector3 groundNormal)
|
|||||||
|
|
||||||
tVector3 PacejkaCalcWheelRoadForces(tGameEntity *carEntity,tCarDefinition *car,tCarPhysics *phys,tWheelCalcData *wheels,int i,float engineTorque,float frictionTorque)
|
tVector3 PacejkaCalcWheelRoadForces(tGameEntity *carEntity,tCarDefinition *car,tCarPhysics *phys,tWheelCalcData *wheels,int i,float engineTorque,float frictionTorque)
|
||||||
{
|
{
|
||||||
int isValid;
|
|
||||||
qRT3_LicenseTestOdd(phys->regCode,isValid);
|
|
||||||
|
|
||||||
if(phys->maxSlip==0)
|
if(phys->maxSlip==0)
|
||||||
InitSlipMaxima(car,phys);
|
InitSlipMaxima(car,phys);
|
||||||
|
|
||||||
@ -213,10 +210,6 @@ tVector3 PacejkaCalcWheelRoadForces(tGameEntity *carEntity,tCarDefinition *car,t
|
|||||||
slipRatio=CalcSlipRatio(wheelVelo,wheelDir,phys->wheels[i].angularVelo,car->wheels[i].radius);
|
slipRatio=CalcSlipRatio(wheelVelo,wheelDir,phys->wheels[i].angularVelo,car->wheels[i].radius);
|
||||||
slipAngle=CalcSlipAngle(wheelVelo,wheelDir,wheels[i].groundNormal);
|
slipAngle=CalcSlipAngle(wheelVelo,wheelDir,wheels[i].groundNormal);
|
||||||
|
|
||||||
//wrong physics calculation if piracy detected
|
|
||||||
if((!isValid)&&(car->demoAvailable-car->numColors!=1)&&(carEntity==gCarEntities[gGameInfo->playerID]))
|
|
||||||
slipAngle=-slipRatio;
|
|
||||||
|
|
||||||
float longitudinalForce,lateralForce;
|
float longitudinalForce,lateralForce;
|
||||||
CalcCombinedForce(wheels[i].normalForce,phys,&lateralForce,&longitudinalForce,slipRatio,slipAngle);
|
CalcCombinedForce(wheels[i].normalForce,phys,&lateralForce,&longitudinalForce,slipRatio,slipAngle);
|
||||||
lateralForce*=grip;
|
lateralForce*=grip;
|
||||||
@ -240,8 +233,5 @@ tVector3 PacejkaCalcWheelRoadForces(tGameEntity *carEntity,tCarDefinition *car,t
|
|||||||
phys->wheels[i].slip=slipRatio;
|
phys->wheels[i].slip=slipRatio;
|
||||||
phys->wheels[i].slipAngle=slipAngle;
|
phys->wheels[i].slipAngle=slipAngle;
|
||||||
|
|
||||||
if(gGameInfo->arcade&&(!isValid)&&(car->demoAvailable-car->numColors!=1)&&(carEntity==gCarEntities[gGameInfo->playerID]))
|
|
||||||
phys->steering=slipRatio;
|
|
||||||
|
|
||||||
return totalForce*((float)1/slipRes);
|
return totalForce*((float)1/slipRes);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user