Example #1
0
    static int MannedTurrets(IshipIGC* pshipParent)
    {
        // loop through all of the ships on that side and count the ones 
        // that are turrets of this.
        int cMannedTurrets = 0;
        
        const ShipListIGC* shipList = pshipParent->GetSide()->GetShips();
        for (const ShipLinkIGC* lShip = shipList->first(); lShip; lShip = lShip->next())
        {
            IshipIGC* pship = lShip->data();
            PlayerInfo* pplayer = (PlayerInfo*)pship->GetPrivateData();

            if (pplayer->LastSeenState() == c_ssTurret)                
            {
                PlayerInfo* pplayerParent = trekClient.FindPlayer(pplayer->LastSeenParent());

                if (pplayerParent && pplayerParent->GetShip() == pshipParent)
                    cMannedTurrets++;
            }
        }

        return cMannedTurrets;
    }
Example #2
0
    static bool CanBoard(IshipIGC* pship)
    {
        PlayerInfo* pPlayer = (PlayerInfo*)pship->GetPrivateData();

        if (pship != trekClient.GetShip() 
            && pship->GetSide() == trekClient.GetSide()
            && pPlayer->LastSeenState() == c_ssDocked 
            && pship->GetPilotType() >= c_ptPlayer)
        {
            HullID          hid = pPlayer->LastSeenShipType();
            assert (hid != NA);
            IhullTypeIGC*   pht = trekClient.m_pCoreIGC->GetHullType(hid);
            assert (pht);

            if ((trekClient.GetShip()->GetPilotType() == c_ptCheatPlayer) ||
                (pht->GetMaxFixedWeapons() != pht->GetMaxWeapons()))
            {
                return true;
            }
        }

        return false;
    }