|
|
|
|
@@ -279,13 +279,9 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|
|
|
|
tCarPhysics *phys=(tCarPhysics*)entity->physics;
|
|
|
|
|
tCarDefinition *car=&(phys->car);
|
|
|
|
|
|
|
|
|
|
int isValid=true;
|
|
|
|
|
float velo=~entity->velo;
|
|
|
|
|
float driveSlip=0,slip=0,angularVelo=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++)
|
|
|
|
|
{
|
|
|
|
|
@@ -297,8 +293,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|
|
|
|
}
|
|
|
|
|
angularVelo+=phys->wheels[i].angularVelo*car->wheels[i].powered;
|
|
|
|
|
}
|
|
|
|
|
if((gMapInfo->demoAvailable+gMapInfo->numObjs))
|
|
|
|
|
isValid=false;
|
|
|
|
|
|
|
|
|
|
if(wheelsOnGround)
|
|
|
|
|
slip/=wheelsOnGround;
|
|
|
|
|
@@ -306,11 +300,7 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|
|
|
|
slip=0;
|
|
|
|
|
CalcThrottleBrake(car,phys,driveSlip,angularVelo,velo,slip);
|
|
|
|
|
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))
|
|
|
|
|
phys->handbrake+=kFrameTime*(1/kHandbrakeTime);
|
|
|
|
|
else
|
|
|
|
|
@@ -320,10 +310,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|
|
|
|
else if(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(gConfig->automatic)
|
|
|
|
|
@@ -415,31 +401,6 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|
|
|
|
phys->throttle=0.7;
|
|
|
|
|
else
|
|
|
|
|
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
|
|
|
|
|
if(phys->rpm<car->clutchRPM)
|
|
|
|
|
@@ -451,19 +412,11 @@ void ControlEntityUserInput(tGameEntity *entity)
|
|
|
|
|
phys->clutch=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!isValid)
|
|
|
|
|
if(gFrameCount>kFPS*30)
|
|
|
|
|
phys->throttle=0;
|
|
|
|
|
|
|
|
|
|
if(GetButtonInput(kInputHorn))
|
|
|
|
|
phys->lightFlags|=kLightFlagHorn;
|
|
|
|
|
else
|
|
|
|
|
phys->lightFlags&=~kLightFlagHorn;
|
|
|
|
|
|
|
|
|
|
if(!valid)
|
|
|
|
|
if(RandomProb(kFrameTime/car->gearSwitchTime*7))
|
|
|
|
|
phys->gear=0;
|
|
|
|
|
|
|
|
|
|
if(GetButtonInput(kInputLeftIndicator))
|
|
|
|
|
phys->lightFlags|=kLightFlagLIndLight;
|
|
|
|
|
else if(GetButtonInput(kInputRightIndicator))
|
|
|
|
|
|