summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-10-16 20:30:10 +0800
committerIru Cai <mytbk920423@gmail.com>2018-10-16 20:45:59 +0800
commitcfbbcd24cd3cc339e38caabc69b1239d0300aba9 (patch)
treefb2d0f3b0ef1b9530997f6c301b442a7a89d97e5
parentd8a722088baad3c9e51d06f3a051ecdde04a8080 (diff)
downloadrich4-cfbbcd24cd3cc339e38caabc69b1239d0300aba9.tar.xz
player_cards_num
-rw-r--r--csrc/cards.c11
-rw-r--r--csrc/cards_ui.c2
2 files changed, 12 insertions, 1 deletions
diff --git a/csrc/cards.c b/csrc/cards.c
index 8772e02..9f3d03e 100644
--- a/csrc/cards.c
+++ b/csrc/cards.c
@@ -108,6 +108,17 @@ int has_card(int p, int c)
return 0;
}
+int player_cards_num(int p)
+{
+ int n = 0;
+ for (int i = 0; i < 15; i++) {
+ if (player_cards[p * 15 + i] == 0)
+ continue;
+ n++;
+ }
+ return n;
+}
+
int use_revenge_card(int p)
{
static const char str_revenge[] = "%s\n\n\xb4_\xa4\xb3\xa5\x64\xa5\xcd\xae\xc4\xa1I"; /* 复仇卡生效!*/
diff --git a/csrc/cards_ui.c b/csrc/cards_ui.c
index de3dfd7..15e2d28 100644
--- a/csrc/cards_ui.c
+++ b/csrc/cards_ui.c
@@ -148,7 +148,7 @@ void cards_ui()
return;
}
if ((dl & 6) && (players[current_player].f22 & 1)) {
- edi = esi = eax = fcn_00441262(current_player);
+ edi = esi = eax = player_cards_num(current_player);
if (eax == 0)
return;
memset(mem, 0, 8);