~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/tron/gCycle.cpp

  • Committer: SwagTron
  • Date: 2019-03-05 07:13:03 UTC
  • Revision ID: swagtron-20190305071303-5m4cn9hs6h8ydsgf
- Ported toggle from 0.4. Seems kind of hacky. Had to add another FindConfigItem of type tConfItemBase due to tab completion using the previous tString function. Plan to change this later, but I really needed the toggle function. Tried to cast the two, but that did not work out. Seemed like the bug-less option for the time being. Those unfamiliar with this function, you can now toggle boolean commands (Ex. toggle text_out)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2425
2425
        currentWall(NULL),
2426
2426
        lastWall(NULL)
2427
2427
{
2428
 
/*    
2429
 
    se_cycleCreatedWriter << p->GetLogName() << this->MapPosition().x << this->MapPosition().y << this->MapDirection().x << this->MapDirection().y << (p->CurrentTeam()?Team()->Name().Filter():"") << se_GameTime();
 
2428
    se_cycleCreatedWriter << p->GetLogName() << this->MapPosition().x << this->MapPosition().y << this->MapDirection().x << this->MapDirection().y << Team()->Name().Filter() << se_GameTime();
2430
2429
    se_cycleCreatedWriter.write();
2431
 
*/
 
2430
 
2432
2431
    windingNumberWrapped_ = windingNumber_ = Grid()->DirectionWinding(dirDrive);
2433
2432
    dirDrive = Grid()->GetDirection(windingNumberWrapped_);
2434
2433
    dir = dirDrive;
2879
2878
#ifdef DEDICATED
2880
2879
    if ( Alive() && currentTime > lastTime + Lag() + 1 )
2881
2880
    {
2882
 
        //sn_ConsoleOut( "0xff7777Admin : 0xffff77BUG had to kill a cycle because it lagged behind in the simulation. Probably the invulnerability bug. Investigate!\n" );
 
2881
        sn_ConsoleOut( "0xff7777Admin : 0xffff77BUG had to kill a cycle because it lagged behind in the simulation. Probably the invulnerability bug. Investigate!\n" );
2883
2882
        st_Breakpoint();
2884
2883
        KillAt( pos );
2885
2884
        ret = false;
4218
4217
                tString logTurnsMsg;
4219
4218
                logTurnsMsg << "death " << MapPosition().x << " " << MapPosition().y << " " << MapDirection().x << " " << MapDirection().y;
4220
4219
                LogPlayersCycleTurns(this, logTurnsMsg);
4221
 
/*
4222
 
                se_cycleDestroyedWriter << Player()->GetUserName() << MapPosition().x << MapPosition().y << MapDirection().x << MapDirection().y << (Player()->CurrentTeam()?ePlayerNetID::FilterName(Team()->Name()):"") << se_GameTime();
 
4220
 
 
4221
                se_cycleDestroyedWriter << Player()->GetUserName() << MapPosition().x << MapPosition().y << MapDirection().x << MapDirection().y << ePlayerNetID::FilterName(Team()->Name()) << se_GameTime();
4223
4222
                se_cycleDestroyedWriter.write();
4224
 
*/
 
4223
 
4225
4224
                Player()->LogActivity(ACTIVITY_DIED);
4226
4225
 
4227
4226
                sg_cycleRespawnZone_Create(this);
4656
4655
bool sg_HideCycles = false;
4657
4656
static tConfItem<bool> sg_HideCyclesConf("HIDE_CYCLES", sg_HideCycles);
4658
4657
 
4659
 
// Should we hide the chat flag above the player's cycle when the user is silenced?
4660
 
static bool se_HideSilencedPyramidChatFlag = true;
4661
 
static tSettingItem<bool> se_HideSilencedPyramidChatFlagConf("HIDE_SILENCED_PYRAMID_CHATFLAG", se_HideSilencedPyramidChatFlag);
4662
 
 
4663
 
 
4664
4658
void gCycle::Render(const eCamera *cam){
4665
4659
    /*
4666
4660
    // for use when there's rendering problems on one specific occasion
4868
4862
            REAL alpha = 1;
4869
4863
            const REAL timeout = .5f;
4870
4864
 
4871
 
            if (bool(player))
 
4865
            if ( bool(player) )
4872
4866
            {
4873
 
                // If the HIDE_SILENCED_PYRAMID_CHATFLAG command is set to false and the player is not silenced, show the tab chatflag.
4874
 
                if (!(se_HideSilencedPyramidChatFlag && player->AccessSilenced()))
4875
 
                {
4876
 
                    if (player->IsChatting())
4877
 
                    {
4878
 
                        renderPyramid = true;
4879
 
                        colorPyramid.b = 0.0f;
4880
 
                    }
4881
 
                    else if (!player->IsActive())
4882
 
                    {
4883
 
                        renderPyramid = true;
4884
 
                        colorPyramid.b = 0.0f;
4885
 
                        colorPyramid.g = 0.0f;
4886
 
                    }
4887
 
                    else if (cam && cam->Center() == this && se_GameTime() < timeout && player->CurrentTeam() && player->CurrentTeam()->NumPlayers() > 1)
4888
 
                    {
4889
 
                        renderPyramid = true;
4890
 
                        alpha = timeout - se_GameTime();
4891
 
                    }
 
4867
                if ( player->IsChatting() )
 
4868
                {
 
4869
                    renderPyramid = true;
 
4870
                    colorPyramid.b = 0.0f;
 
4871
                }
 
4872
                else if ( !player->IsActive() )
 
4873
                {
 
4874
                    renderPyramid = true;
 
4875
                    colorPyramid.b = 0.0f;
 
4876
                    colorPyramid.g = 0.0f;
 
4877
                }
 
4878
                else if ( cam && cam->Center() == this && se_GameTime() < timeout && player->CurrentTeam() && player->CurrentTeam()->NumPlayers() > 1 )
 
4879
                {
 
4880
                    renderPyramid = true;
 
4881
                    alpha = timeout - se_GameTime();
4892
4882
                }
4893
4883
            }
 
4884
 
4894
4885
            if ( renderPyramid )
4895
4886
            {
4896
4887
                GLfloat s=sin(lastTime);
7078
7069
        int pos = 0; //
7079
7070
        tString PlayerName = ePlayerNetID::FilterName(params.ExtractNonBlankSubString(pos));
7080
7071
        ePlayerNetID *pPlayer = ePlayerNetID::FindPlayerByName(PlayerName);
7081
 
 
7082
 
        if (!pPlayer || !pPlayer->CanRespawn())
7083
 
        {
 
7072
        if(!pPlayer)
7084
7073
            return;
7085
 
        }
7086
7074
 
7087
7075
        //const tString message_str = params.ExtractNonBlankSubString(pos);
7088
7076
        //int message = atoi(message_str);