示例#1
0
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);
    }
}
示例#2
0
InventoryItemRef ModuleManager::GetLoadedChargeOnModule(EVEItemFlags flag)
{
    GenericModule * mod = m_Modules->GetModule(flag);
	if( mod->isLoaded() )
	{
		if( mod != NULL )
		{
			if( mod->isLoaded() )
				return mod->getLoadedChargeRef();
			else
				return InventoryItemRef();
		}
	}
	else
		GetLogger()->Warning( "ModuleManager::UnloadCharge()", "WARNING! Called UnloadCharge() on a module that is NOT loaded or not a charged module!" );

	return InventoryItemRef();
}