+/* $NetBSD: dr_5.c,v 1.14 2009/03/14 22:52:52 dholland Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char sccsid[] = "@(#)dr_5.c 5.4 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)dr_5.c 8.2 (Berkeley) 4/28/95";
+#else
+__RCSID("$NetBSD: dr_5.c,v 1.14 2009/03/14 22:52:52 dholland Exp $");
+#endif
#endif /* not lint */
-#include "externs.h"
+#include <sys/types.h>
+#include "extern.h"
-subtract(from, totalfrom, crewfrom, fromcap, pcfrom)
-struct ship *from, *fromcap;
-int pcfrom;
-register int totalfrom, crewfrom[3];
+void
+subtract(struct ship *from, struct ship *fromcap, int totalfrom, int *crewfrom,
+ int pcfrom)
{
- register int n;
+ int n;
if (fromcap == from && totalfrom) { /* if not captured */
for (n = 0; n < 3; n++) {
totalfrom = 0;
}
}
- Write(W_CREW, from, 0, crewfrom[0], crewfrom[1], crewfrom[2], 0);
+ send_crew(from, crewfrom[0], crewfrom[1], crewfrom[2]);
} else if (totalfrom) {
pcfrom -= totalfrom;
pcfrom = pcfrom < 0 ? 0 : pcfrom;
- Write(W_PCREW, from, 0, pcfrom, 0, 0, 0);
+ send_pcrew(from, pcfrom);
}
}
-mensent(from, to, crew, captured, pc, isdefense)
-struct ship *from, *to, **captured;
-int crew[3], *pc;
-char isdefense;
+int
+mensent(struct ship *from, struct ship *to, int *crew, struct ship **captured,
+ int *pc, int isdefense)
{ /* returns # of crew squares sent */
int men = 0;
- register int n;
+ int n;
int c1, c2, c3;
- register struct BP *bp;
+ struct BP *bp;
*pc = from->file->pcrew;
*captured = from->file->captured;