void CafterburnerIGC::SetShip(IshipIGC* newVal, Mount mount) { //There may be only a single reference to this part ... so make sure the part //does not get deleted midway through things AddRef(); if (m_ship) { m_ship->DeletePart(this); m_ship->Release(); } assert (m_mountID == c_mountNA); m_ship = newVal; if (m_ship) { m_ship->AddRef(); m_ship->AddPart(this); SetMountID(mount); } Release(); }
void CdispenserIGC::SetShip(IshipIGC* newVal, Mount mount) { //There may be only a single reference to this part ... so make sure the part //does not get deleted midway through things AddRef(); if (m_ship) { m_ship->DeletePart(this); m_ship->Release(); } assert (m_mountID == c_mountNA); m_ship = newVal; if (m_ship) { m_ship->AddRef(); m_ship->AddPart(this); m_emissionPt = m_ship->GetHitTest()->GetFrameOffset("missemt"); SetMountID(mount); } Release(); }