xref: /csrg-svn/games/trek/systemname.c (revision 60859)
125995Smckusick /*
2*60859Sbostic  * Copyright (c) 1980, 1993
3*60859Sbostic  *	The Regents of the University of California.  All rights reserved.
434205Sbostic  *
542606Sbostic  * %sccs.include.redist.c%
625995Smckusick  */
725995Smckusick 
811700Smckusick #ifndef lint
9*60859Sbostic static char sccsid[] = "@(#)systemname.c	8.1 (Berkeley) 05/31/93";
1034205Sbostic #endif /* not lint */
1111700Smckusick 
1211700Smckusick # include	"trek.h"
1311700Smckusick 
1411700Smckusick /*
1511700Smckusick **  RETRIEVE THE STARSYSTEM NAME
1611700Smckusick **
1711700Smckusick **	Very straightforward, this routine just gets the starsystem
1811700Smckusick **	name.  It returns zero if none in the specified quadrant
1911700Smckusick **	(which, by the way, is passed it).
2011700Smckusick **
2111700Smckusick **	This routine knows all about such things as distressed
2211700Smckusick **	starsystems, etc.
2311700Smckusick */
2411700Smckusick 
systemname(q1)2511700Smckusick char *systemname(q1)
2611700Smckusick struct quad	*q1;
2711700Smckusick {
2811700Smckusick 	register struct quad	*q;
2911700Smckusick 	register int		i;
3011700Smckusick 
3111700Smckusick 	q = q1;
3211700Smckusick 
3312738Slayer 	i = q->qsystemname;
3411700Smckusick 	if (i & Q_DISTRESSED)
3511700Smckusick 		i = Event[i & Q_SYSTEM].systemname;
3611700Smckusick 
3712738Slayer 	i &= Q_SYSTEM;
3811700Smckusick 	if (i == 0)
3911700Smckusick 		return (0);
4011700Smckusick 	return (Systemname[i]);
4111700Smckusick }
42