summaryrefslogtreecommitdiffstats
path: root/sail/parties.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-03-14 22:52:52 +0000
committerdholland <dholland@NetBSD.org>2009-03-14 22:52:52 +0000
commite98a44895c7ca5a00b080fce0b3cbb16bcdff859 (patch)
treea74a3e03e0056c3de3d2b751b6dea1f59baec1c7 /sail/parties.c
parent5e8d1f0902b592fc872212ecccaca23c8ce85231 (diff)
downloadbsdgames-darwin-e98a44895c7ca5a00b080fce0b3cbb16bcdff859.tar.gz
bsdgames-darwin-e98a44895c7ca5a00b080fce0b3cbb16bcdff859.tar.zst
bsdgames-darwin-e98a44895c7ca5a00b080fce0b3cbb16bcdff859.zip
Create some abstraction for sending messages.
Make a send and receive function for each possible message. Make these have useful argument signatures. Hide the list of message codes inside sync.c.
Diffstat (limited to 'sail/parties.c')
-rw-r--r--sail/parties.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sail/parties.c b/sail/parties.c
index d55e4620..43e94416 100644
--- a/sail/parties.c
+++ b/sail/parties.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parties.c,v 1.11 2003/08/07 09:37:43 agc Exp $ */
+/* $NetBSD: parties.c,v 1.12 2009/03/14 22:52:52 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)parties.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: parties.c,v 1.11 2003/08/07 09:37:43 agc Exp $");
+__RCSID("$NetBSD: parties.c,v 1.12 2009/03/14 22:52:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -71,7 +71,14 @@ unboard(struct ship *ship, struct ship *to, int isdefense)
struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP;
int n;
- for (n = 0; n < NBP; p++, n++)
- if (p->turnsent && (p->toship == to || isdefense || ship == to))
- Write(isdefense ? W_DBP : W_OBP, ship, n, 0, 0, 0);
+ for (n = 0; n < NBP; p++, n++) {
+ if (p->turnsent &&
+ (p->toship == to || isdefense || ship == to)) {
+ if (isdefense) {
+ send_dbp(ship, n, 0, 0, 0);
+ } else {
+ send_obp(ship, n, 0, 0, 0);
+ }
+ }
+ }
}