~armagetronad-ct/armagetronad/0.2.8-armagetronad-sty+ct+lua

« back to all changes in this revision

Viewing changes to src/tron/gCycleMovement.cpp

Merge with mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
3120
3120
                        if( rear.type != gSENSOR_SELF && rear.type != gSENSOR_TEAMMATE )
3121
3121
                        {
3122
3122
                            REAL timing = rear.hit/(verletSpeed_ + 1E-10);
 
3123
 
 
3124
                            // extra factor: when the number of axes is not 4,
 
3125
                            // the effective speed at which the cycle would increase
 
3126
                            // the here detected distance is reduced. Thus, we
 
3127
                            // need to divide the timing by that speed factor.
 
3128
                            REAL factor = -lastDirDrive*dirDrive*d;
 
3129
                            if(factor > 0 && factor < 1)
 
3130
                                timing /= factor;
 
3131
 
3123
3132
                            player->AnalyzeTiming( timing );
3124
3133
                        }
3125
3134
                    }
3389
3398
                // and report
3390
3399
                // player->AnalyzeTiming( timing );
3391
3400
                */
 
3401
                uncannyTimingToReport_ = false;
3392
3402
            }
3393
3403
            else
3394
3404
            {
3930
3940
                            // need many attempts
3931
3941
                            verletSpeed_=lastSpeed;
3932
3942
                            acceleration=lastAcceleration;
3933
 
                            return TimestepCore( runOutTime, false ) || TimestepCore( currentTime );
 
3943
 
 
3944
                            // simulate until rubber runs out (no need to recalc acceleration)
 
3945
                            if ( TimestepCore( runOutTime, false ) )
 
3946
                                return true;
 
3947
 
 
3948
                            // simulate post-rubber gap or, more frequently, the crash into the next wall
 
3949
                            return TimestepCore( currentTime );
3934
3950
                        }
3935
3951
                    }
3936
3952
                }
3962
3978
            if (step<0)
3963
3979
                step=0;
3964
3980
 
 
3981
            // ignore the next destination position for now.
 
3982
            // if the space ahead is far less that what the cycle would traverse
 
3983
            // until the destination turn time, die.
 
3984
            // the destination must have come from a 0.2.6 or cheating client with a wrong time set;
 
3985
            // the control code calling this has no clue that the cycle has entered the rubber gap
 
3986
            // and would respect the destination's position, allowing for extremely deep grinds.
 
3987
            if( sn_GetNetState() != nCLIENT &&
 
3988
                currentDestination && !currentDestination->hasBeenUsed && 
 
3989
                rubberneeded >= rubberAvailable &&
 
3990
                space * 1.25 < (currentDestination->gameTime - lastTime) * verletSpeed_)
 
3991
            {
 
3992
                throw gCycleDeath(pos + dirDrive * space);
 
3993
            }
 
3994
 
3965
3995
            //{
3966
3996
            //    rubber+=step;
3967
3997
            //    step=0;
4103
4133
 
4104
4134
    tASSERT( rubber >= 0 );
4105
4135
 
4106
 
    // use up rubber from tunneling (calculated by CalculateAcceleration
 
4136
    // use up rubber from tunneling (calculated by CalculateAcceleration)
4107
4137
    if ( rubberEffectiveness > 0 )
4108
4138
    {
4109
 
        rubber += rubberUsage * ts * verletSpeed_ / rubberEffectiveness;            }
 
4139
        rubber += rubberUsage * ts * verletSpeed_ / rubberEffectiveness; 
 
4140
    }
4110
4141
    else if ( rubberUsage > 0 )
4111
4142
    {
4112
4143
        rubber = rubber_granted + 10;
4115
4146
 
4116
4147
    // decide over kill
4117
4148
    bool rubberUsedUp = false;
4118
 
    if ( rubber > rubber_granted || ( sg_cycleWidthRubberMax == 0 && sg_cycleWidthRubberMin == 0 ) )
 
4149
    if ( rubber > rubber_granted )
4119
4150
    {
4120
4151
        if ( sn_GetNetState() != nCLIENT )
4121
4152
        {