Annotation of 43BSD/games/sail/parties.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1983 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  */
        !             6: 
        !             7: #ifndef lint
        !             8: static char sccsid[] = "@(#)parties.c  5.1 (Berkeley) 5/29/85";
        !             9: #endif not lint
        !            10: 
        !            11: #include "externs.h"
        !            12: 
        !            13: meleeing(from, to)
        !            14: struct ship *from;
        !            15: register struct ship *to;
        !            16: {
        !            17:        register struct BP *p = from->file->OBP;
        !            18:        register struct BP *q = p + NBP;
        !            19: 
        !            20:        for (; p < q; p++)
        !            21:                if (p->turnsent && p->toship == to)
        !            22:                        return 1;
        !            23:        return 0;
        !            24: }
        !            25: 
        !            26: boarding(from, isdefense)
        !            27: register struct ship *from;
        !            28: char isdefense;
        !            29: {
        !            30:        register struct BP *p = isdefense ? from->file->DBP : from->file->OBP;
        !            31:        register struct BP *q = p + NBP;
        !            32: 
        !            33:        for (; p < q; p++)
        !            34:                if (p->turnsent)
        !            35:                        return 1;
        !            36:        return 0;
        !            37: }
        !            38: 
        !            39: unboard(ship, to, isdefense)
        !            40: register struct ship *ship, *to;
        !            41: register char isdefense;
        !            42: {
        !            43:        register struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP;
        !            44:        register n;
        !            45: 
        !            46:        for (n = 0; n < NBP; p++, n++)
        !            47:                if (p->turnsent && (p->toship == to || isdefense || ship == to))
        !            48:                        Write(isdefense ? W_DBP : W_OBP, ship, 0, n, 0, 0, 0);
        !            49: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.