Commit | Line | Data |
---|---|---|
ecb38d15 | 1 | #ifndef lint |
06d69904 | 2 | static char sccsid[] = "@(#)systemname.c 4.2 (Berkeley) %G%"; |
ecb38d15 KM |
3 | #endif not lint |
4 | ||
5 | # include "trek.h" | |
6 | ||
7 | /* | |
8 | ** RETRIEVE THE STARSYSTEM NAME | |
9 | ** | |
10 | ** Very straightforward, this routine just gets the starsystem | |
11 | ** name. It returns zero if none in the specified quadrant | |
12 | ** (which, by the way, is passed it). | |
13 | ** | |
14 | ** This routine knows all about such things as distressed | |
15 | ** starsystems, etc. | |
16 | */ | |
17 | ||
18 | char *systemname(q1) | |
19 | struct quad *q1; | |
20 | { | |
21 | register struct quad *q; | |
22 | register int i; | |
23 | ||
24 | q = q1; | |
25 | ||
06d69904 | 26 | i = q->qsystemname; |
ecb38d15 KM |
27 | if (i & Q_DISTRESSED) |
28 | i = Event[i & Q_SYSTEM].systemname; | |
29 | ||
06d69904 | 30 | i &= Q_SYSTEM; |
ecb38d15 KM |
31 | if (i == 0) |
32 | return (0); | |
33 | return (Systemname[i]); | |
34 | } |