X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/b8768ee618f77cc843a7f19ec2ff5d9a13d1e184..65d87971fd6c37608d05ab96cf3c67e0a3bcb340:/usr/src/games/trek/klmove.c diff --git a/usr/src/games/trek/klmove.c b/usr/src/games/trek/klmove.c index 513b0cc614..66f0628660 100644 --- a/usr/src/games/trek/klmove.c +++ b/usr/src/games/trek/klmove.c @@ -1,6 +1,23 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + #ifndef lint -static char sccsid[] = "@(#)klmove.c 4.1 (Berkeley) %G%"; -#endif not lint +static char sccsid[] = "@(#)klmove.c 5.3 (Berkeley) %G%"; +#endif /* not lint */ # include "trek.h" @@ -55,7 +72,7 @@ int fl; continue; /* compute distance to move */ motion = ranf(75) - 25; - motion =* k->avgdist * Param.movefac[2 * Move.newquad + fl]; + motion *= k->avgdist * Param.movefac[2 * Move.newquad + fl]; /* compute direction */ dx = Ship.sectx - k->x + ranf(3) - 1; dy = Ship.secty - k->y + ranf(3) - 1; @@ -86,15 +103,15 @@ int fl; qx = Ship.quadx; qy = Ship.quady; if (lookx < 0) - qx =- 1; + qx -= 1; else if (lookx >= NSECTS) - qx =+ 1; + qx += 1; if (looky < 0) - qy =- 1; + qy -= 1; else if (looky >= NSECTS) - qy =+ 1; + qy += 1; if (qx < 0 || qx >= NQUADS || qy < 0 || qy >= NQUADS || Quad[qx][qy].stars < 0 || Quad[qx][qy].klings > MAXKLQUAD - 1) break; @@ -104,16 +121,16 @@ int fl; k->x, k->y, qx, qy); motion = Quad[qx][qy].scanned; if (motion >= 0 && motion < 1000) - Quad[qx][qy].scanned =+ 100; + Quad[qx][qy].scanned += 100; motion = Quad[Ship.quadx][Ship.quady].scanned; if (motion >= 0 && motion < 1000) - Quad[Ship.quadx][Ship.quady].scanned =- 100; + Quad[Ship.quadx][Ship.quady].scanned -= 100; } Sect[k->x][k->y] = EMPTY; - Quad[qx][qy].klings =+ 1; - Etc.nkling =- 1; + Quad[qx][qy].klings += 1; + Etc.nkling -= 1; bmove(&Etc.klingon[Etc.nkling], k, sizeof *k); - Quad[Ship.quadx][Ship.quady].klings =- 1; + Quad[Ship.quadx][Ship.quady].klings -= 1; k = 0; break; }