Fix multiplayer parity and release regressions
This commit is contained in:
parent
b18d9392d8
commit
c0ff78322d
17 changed files with 378 additions and 17 deletions
|
|
@ -9,6 +9,7 @@ enum Status {
|
|||
INVALID_BUYER,
|
||||
INVALID_OFFER,
|
||||
INVALID_SELECTION,
|
||||
RESERVED,
|
||||
TRANSACTION_FAILED,
|
||||
}
|
||||
|
||||
|
|
@ -46,5 +47,7 @@ func get_message() -> String:
|
|||
return "invalid buyer offer."
|
||||
Status.INVALID_SELECTION:
|
||||
return "the fish selection is invalid."
|
||||
Status.RESERVED:
|
||||
return "reserved fish cannot be sold."
|
||||
_:
|
||||
return "transaction failed."
|
||||
|
|
|
|||
|
|
@ -11,14 +11,17 @@ signal sale_completed(result: FishSaleResultType)
|
|||
|
||||
var _inventory: FishInventoryType
|
||||
var _wallet: PlayerWalletType
|
||||
var _reservations: PlayerAssetReservationService
|
||||
|
||||
|
||||
func setup(
|
||||
inventory: FishInventoryType,
|
||||
wallet: PlayerWalletType,
|
||||
reservations: PlayerAssetReservationService = null,
|
||||
) -> void:
|
||||
_inventory = inventory
|
||||
_wallet = wallet
|
||||
_reservations = reservations
|
||||
|
||||
|
||||
func can_sell(
|
||||
|
|
@ -114,6 +117,12 @@ func _validate_batch(
|
|||
if fish_catch == null:
|
||||
result.status = FishSaleResultType.Status.NOT_FOUND
|
||||
return result
|
||||
if (
|
||||
_reservations != null
|
||||
and _reservations.is_fish_reserved(catch_id)
|
||||
):
|
||||
result.status = FishSaleResultType.Status.RESERVED
|
||||
return result
|
||||
if fish_catch.is_favorited:
|
||||
contains_favorite = true
|
||||
if fish_catch.sale_value < 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue