void ModuleManager::UnfitModule(uint32 itemID) { GenericModule * mod = m_Modules->GetModule(itemID); if( mod != NULL ) { if( mod->isLoaded() ) { InventoryItemRef loadedChargeRef = mod->getLoadedChargeRef(); if( IsStation(m_Ship->locationID()) ) loadedChargeRef->Move(m_Ship->locationID(), flagHangar); // used to be (m_pOperator->GetLocationID(), flag) else { m_Ship->ValidateAddItem(flagCargoHold,loadedChargeRef); //if( m_Ship->ValidateAddItem(flagCargoHold,loadedChargeRef) ) //{ loadedChargeRef->Move(m_Ship->itemID(), flagCargoHold); // used to be (m_pOperator->GetLocationID(), flag) mod->unload(); //} //else // throw PyException( MakeCustomError( "Not enough cargo space!") ); } } mod->offline(); m_Modules->RemoveModule(itemID); } }
void ModuleManager::UnloadCharge(EVEItemFlags flag) { GenericModule * mod = m_Modules->GetModule(flag); if( mod->isLoaded() ) { if( mod != NULL ) { if( mod->isLoaded() ) { InventoryItemRef loadedChargeRef = mod->getLoadedChargeRef(); mod->unload(); } } } else GetLogger()->Warning( "ModuleManager::UnloadCharge()", "WARNING! Called UnloadCharge() on a module that is NOT loaded or not a charged module!" ); }