143 {
144 SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
146 ItemBase selected_item =
ItemBase.Cast(ItemManager.GetInstance().GetSelectedItem());
147
149 {
150 if( selected_item )
151 {
152 if( ent != selected_item)
153 {
154 if( selected_item &&
g_Game.GetPlayer().CanDropEntity( selected_item ) )
155 {
156 bool draggable = false;
157
158 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
159 draggable = !player.GetInventory().HasInventoryReservation( selected_item, null ) && !player.IsItemsToDelete();
160 draggable = draggable && selected_item.GetInventory().CanRemoveEntity();
161
163 {
164 if( selected_item.GetTargetQuantityMax() < selected_item.GetQuantity() )
165 selected_item.SplitIntoStackMaxClient( null, -1 );
166 else
167 player.PhysicalPredictiveDropItem( selected_item );
168 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
169 return true;
170 }
171 }
172 }
173 }
174 else
175 {
176 if( ent && ent.GetInventory().CanRemoveEntity())
177 {
179 if( item_in_hands )
180 {
181 if( GameInventory.CanSwapEntitiesEx( item_in_hands, ent ) )
182 {
183 g_Game.GetPlayer().PredictiveSwapEntities( item_in_hands, ent );
184 return true;
185 }
186 }
187 else
188 {
189 if(
g_Game.GetPlayer().GetHumanInventory().CanAddEntityInHands( ent ) )
190 {
191 g_Game.GetPlayer().PredictiveTakeEntityToHands( ent );
192 return true;
193 }
194 }
195 }
196 }
197 }
198
199 return false;
200 }
class GP5GasMask extends MaskBase ItemBase
override EntityAI GetFocusedItem()
ref array< EntityAI > m_ShowedItems