From e98a44895c7ca5a00b080fce0b3cbb16bcdff859 Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 14 Mar 2009 22:52:52 +0000 Subject: 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. --- sail/parties.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'sail/parties.c') 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); + } + } + } } -- cgit v1.2.3