@@ -455,15 +455,8 @@ bool Inventory::drop(const String &item_id, const int &amount, const Dictionary
455455 ERR_FAIL_COND_V_MSG (amount < 0 , false , " 'amount' is negative." );
456456 if (amount == 0 )
457457 return false ;
458- ERR_FAIL_NULL_V_MSG (get_database (), false , " 'database' is null." );
459- Ref<ItemDefinition> _definition = get_database ()->get_item (item_id);
460- ERR_FAIL_NULL_V_MSG (_definition, false , " 'item_definition' is null." );
461- if (_definition->get_properties ().has (" dropped_item" )) {
462- String path = _definition->get_properties ()[" dropped_item" ];
463- emit_signal (" request_drop_obj" , path, item_id, amount, properties);
464- return true ;
465- }
466- return false ;
458+ emit_signal (" request_drop_item" , item_id, amount, properties);
459+ return true ;
467460}
468461
469462void Inventory::drop_all_stacks () {
@@ -706,7 +699,7 @@ void Inventory::_bind_methods() {
706699 ADD_SIGNAL (MethodInfo (" emptied" ));
707700 ADD_SIGNAL (MethodInfo (" updated_stack" , PropertyInfo (Variant::INT, " stack_index" )));
708701
709- ADD_SIGNAL (MethodInfo (" request_drop_obj " , PropertyInfo (Variant::STRING, " drop_item_packed_scene_path " ) , PropertyInfo (Variant::STRING, " item_id" ), PropertyInfo (Variant::INT, " amount" ), PropertyInfo (Variant::DICTIONARY, " item_properties" )));
702+ ADD_SIGNAL (MethodInfo (" request_drop_item " , PropertyInfo (Variant::STRING, " item_id" ), PropertyInfo (Variant::INT, " amount" ), PropertyInfo (Variant::DICTIONARY, " item_properties" )));
710703
711704 ADD_PROPERTY (PropertyInfo (Variant::ARRAY, " stacks" , PROPERTY_HINT_ARRAY_TYPE, vformat (" %s/%s:%s" , Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, " ItemStack" )), " set_stacks" , " get_stacks" );
712705 ADD_PROPERTY (PropertyInfo (Variant::STRING, " inventory_name" ), " set_inventory_name" , " get_inventory_name" );
0 commit comments