~armagetronad-dev/armagetronad/armagetronad-old-glancing

« back to all changes in this revision

Viewing changes to src/engine/eTeam.cpp

Merge with 0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
485
485
    {
486
486
        sn_ConsoleOut( tOutput( "$invite_team_invite", player->GetColoredName(), Name() ) );
487
487
    }
488
 
    player->invitations_.insert( this );
 
488
    player->AddInvitation( this );
489
489
}
490
490
 
491
491
// revoke an invitation
492
492
void eTeam::UnInvite( ePlayerNetID * player )
493
493
{
494
494
    tASSERT( player );
495
 
    size_t wasInvited = player->invitations_.erase( this );
 
495
    bool wasInvited = player->RemoveInvitation( this );
496
496
    if ( player->CurrentTeam() == this && this->IsLockedFor( player ) )
497
497
    {
498
498
        sn_ConsoleOut( tOutput( "$invite_team_kick", player->GetColoredName(), Name() ) );
510
510
    return player->invitations_.find( const_cast< eTeam * >( this ) ) != player->invitations_.end();
511
511
}
512
512
 
 
513
std::vector< const ePlayerNetID * > eTeam::InterestingInvitedPlayers() const
 
514
{
 
515
    std::vector< const ePlayerNetID * > invites;
 
516
    for ( int i = se_PlayerNetIDs.Len() - 1; i >= 0; --i )
 
517
    {
 
518
        ePlayerNetID *p = se_PlayerNetIDs( i );
 
519
        if ( IsInvited( p ) && p->CurrentTeam() != this )
 
520
            invites.push_back( p );
 
521
    }
 
522
    return invites;
 
523
}
 
524
 
513
525
void eTeam::AddScore ( int s )
514
526
{
515
527
    if( se_warmup.IsWarmupMode() )
1731
1743
    // revoke all invitations
1732
1744
    for ( int i = se_PlayerNetIDs.Len()-1; i >= 0; --i )
1733
1745
    {
1734
 
        se_PlayerNetIDs(i)->invitations_.erase( this );
 
1746
        se_PlayerNetIDs(i)->RemoveInvitation( this );
1735
1747
    }
1736
1748
}
1737
1749
// *******************************************************************************