Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed May 29, 2023
1 parent f6809ce commit 68b4c53
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 24 deletions.
12 changes: 6 additions & 6 deletions Assets/Prefabs/Menus/Card Editor Menu.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Assets/Scripts/Cgs/CardGameView/Multiplayer/CardStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ private void DragCard(PointerEventData eventData)
else
PopCard();

var cardModel = CardModel.CreateDrag(eventData, cardModelPrefab, transform, unityCard, true,
CardModel.CreateDrag(eventData, cardModelPrefab, transform, unityCard, true,
PlayController.Instance.playMat);
CgsNetManager.Instance.LocalPlayer.RemovedCard = cardModel;

RemovePointer(eventData);

Expand Down
14 changes: 1 addition & 13 deletions Assets/Scripts/Cgs/Play/Multiplayer/CgsNetPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ public IReadOnlyList<IReadOnlyList<UnityCard>> HandCards

private NetworkList<CgsNetString> _handNames;

public CardModel RemovedCard { get; set; }

private void Awake()
{
_handCards = new NetworkList<CgsNetStringList>();
Expand Down Expand Up @@ -344,17 +342,7 @@ private void RemoveAtServerRpc(NetworkObjectReference stack, int index)
{
Debug.Log($"[CgsNet Player] Remove at {index}!");
var cardStack = ((NetworkObject) stack).GetComponent<CardStack>();
var removedCardId = cardStack.RemoveAt(index);
SyncRemovedCardOwnerClientRpc(removedCardId, OwnerClientRpcParams);
}

[ClientRpc]
// ReSharper disable once UnusedParameter.Local
private void SyncRemovedCardOwnerClientRpc(string removedCardId, ClientRpcParams clientRpcParams = default)
{
if (RemovedCard != null)
RemovedCard.Value = CardGameManager.Current.Cards[removedCardId];
RemovedCard = null;
cardStack.RemoveAt(index);
}

public void RequestDeal(NetworkObject stack, int count)
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectSettings.asset

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pages/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ permalink: roadmap.html
# Roadmap

## What's New - v1.84
- Bug-Fix: Card in hand transforms into card that is drawn
- Added labels to buttons

## Active Sprint
- Bug: Card in hand transforms into card that is drawn (https://www.youtube.com/shorts/pYG0N9TqMmA)
- Bug: Card gets stuck on screen
- Bug: Card get stuck on screen when dragging from search results in deck editor
- Cards: Validation for id
Expand Down

0 comments on commit 68b4c53

Please sign in to comment.