Ejemplo n.º 1
0
 static int NumTurrets(IshipIGC* pship)
 {
     PlayerInfo* pPlayer = (PlayerInfo*)pship->GetPrivateData();
     const IhullTypeIGC* pHullType = trekClient.GetCore()->GetHullType(pPlayer->LastSeenShipType());
      
     // if we have a real ship...
     if (pHullType)
         return pHullType->GetMaxWeapons() - pHullType->GetMaxFixedWeapons();
     else
         return 0;
 }
Ejemplo n.º 2
0
    static ZString HullName(ImodelIGC* pmodel)
    {
        if (pmodel->GetObjectType() == OT_ship)
        {
            PlayerInfo* pPlayer = (PlayerInfo*)((IshipIGC*)pmodel)->GetPrivateData();

            IhullTypeIGC* phull = trekClient.GetCore()->GetHullType(pPlayer->LastSeenShipType());
   
            if (phull == NULL)
                return "<bug>";
            else
                return phull->GetName();
        }
        else
        {
            return "";
        }
    }
Ejemplo n.º 3
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;
    }