Commit 8ae57b1a authored by mercury233's avatar mercury233

prevent "picking up" dying card in deck builder

parent d6f3022d
......@@ -5,6 +5,7 @@ using System;
public class MonoCardInDeckManager : MonoBehaviour {
int loadedPicCode = 0;
YGOSharp.Banlist loaded_banlist = null;
public bool dying = false;
bool died = false;
public YGOSharp.Card cardData=new YGOSharp.Card();
......@@ -61,6 +62,7 @@ public class MonoCardInDeckManager : MonoBehaviour {
}
else
{
dying = true;
died = true;
gameObject.SetActive(false);
}
......@@ -102,6 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour {
Vector3 to_position = getGoodPosition(0);
Vector3 delta_position = to_position - form_position;
GetComponent<Rigidbody>().AddForce(delta_position * 200);
dying = true;
}
}
......
......@@ -1257,7 +1257,8 @@ public class DeckManager : ServantWithCardDescription
goLast = gameObject;
timeLastDown = Program.TimePassed();
MonoCardInDeckManager MonoCardInDeckManager_ = gameObject.GetComponent<MonoCardInDeckManager>();
if (MonoCardInDeckManager_ != null)
cardPicLoader cardPicLoader_ = gameObject.GetComponent<cardPicLoader>();
if (MonoCardInDeckManager_ != null && !MonoCardInDeckManager_.dying)
{
if (doubleClick && condition == Condition.editDeck && deck.GetCardCount(MonoCardInDeckManager_.cardData.Id) < currentBanlist.GetQuantity(MonoCardInDeckManager_.cardData.Id))
{
......@@ -1276,11 +1277,9 @@ public class DeckManager : ServantWithCardDescription
MonoCardInDeckManager_.beginDrag();
}
}
if (condition == Condition.editDeck)
else if (cardPicLoader_ != null)
{
cardPicLoader cardPicLoader_ = gameObject.GetComponent<cardPicLoader>();
if (cardPicLoader_ != null)
if (condition == Condition.editDeck)
{
if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment