Now:
class ActionFillBottleBaseCB : ActionContinuousBaseCB { private int m_liquid_type; override void CreateActionComponent() { m_liquid_type = ActionFillBottleBase.Cast( m_ActionData.m_Action ).GetLiquidType( m_ActionData.m_Player, m_ActionData.m_Target, m_ActionData.m_MainItem ); m_ActionData.m_ActionComponent = new CAContinuousFill(UAQuantityConsumed.FILL_LIQUID, m_liquid_type); //first implementation for obtaining the fuel from the feed faster //TODO:: make some proper get method, maybe param in config? if ( m_ActionData.m_Target.GetObject() && m_ActionData.m_Target.GetObject().GetType() == "Land_FuelStation_Feed") { m_ActionData.m_ActionComponent = new CAContinuousFill(UAQuantityConsumed.FUEL, m_liquid_type); } } };
You can see that action new called twice when we tried to fill Canister
We need add else statement
if ( m_ActionData.m_Target.GetObject() && m_ActionData.m_Target.GetObject().GetType() == "Land_FuelStation_Feed") { m_ActionData.m_ActionComponent = new CAContinuousFill(UAQuantityConsumed.FUEL, m_liquid_type); } else { m_ActionData.m_ActionComponent = new CAContinuousFill(UAQuantityConsumed.FILL_LIQUID, m_liquid_type); }