修复物品拖拽bug
This commit is contained in:
parent
34039547f9
commit
f2173d2ae1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -22,17 +22,17 @@ void UContainerInfo::InitContainerByShape(UShapeAsset* InContainerShape)
|
||||
}
|
||||
}
|
||||
|
||||
bool UContainerInfo::AddContainerItem(FContainerItem Item, int32& ItemID)
|
||||
int32 UContainerInfo::AddContainerItem(FContainerItem Item)
|
||||
{
|
||||
if (!IsItemInContainerShape(Item))
|
||||
{
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
if (IsItemOverlapOtherItem(Item))
|
||||
{
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
ItemID = NextItemID;
|
||||
int32 ItemID = NextItemID;
|
||||
Items.Add(NextItemID, Item);
|
||||
++NextItemID;
|
||||
//设置容器指定位置的占用状态
|
||||
@ -46,7 +46,7 @@ bool UContainerInfo::AddContainerItem(FContainerItem Item, int32& ItemID)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return ItemID;
|
||||
}
|
||||
|
||||
bool UContainerInfo::RemoveContainerItem(const int32& ItemID)
|
||||
@ -163,8 +163,7 @@ bool UContainerInfo::LoadFromSaveData(FPrimaryAssetId ShapeID, const TArray<FCon
|
||||
NewItem.RewardItem = Cast<UFishingRewardDataAsset>(RewardItemPath.TryLoad());
|
||||
//添加物品到容器中
|
||||
FIntPoint Position(ItemData.PosX, ItemData.PosY);
|
||||
int32 ItemID;
|
||||
AddContainerItem(NewItem, ItemID);
|
||||
AddContainerItem(NewItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -112,7 +112,7 @@ public:
|
||||
void InitContainerByShape(UShapeAsset* InContainerShape);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
bool AddContainerItem(FContainerItem Item, int32& ItemID);
|
||||
int32 AddContainerItem(FContainerItem Item);
|
||||
UFUNCTION(BlueprintPure)
|
||||
bool RemoveContainerItem(const int32& ItemID);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user