set Mpos properly in endmsg()
[unix-history] / usr / src / games / trek / check_out.c
CommitLineData
938789bb
KM
1#ifndef lint
2static char sccsid[] = "@(#)check_out.c 4.1 (Berkeley) %G%";
3#endif not lint
4
5# include "trek.h"
6
7/*
8** CHECK IF A DEVICE IS OUT
9**
10** The indicated device is checked to see if it is disabled. If
11** it is, an attempt is made to use the starbase device. If both
12** of these fails, it returns non-zero (device is REALLY out),
13** otherwise it returns zero (I can get to it somehow).
14**
15** It prints appropriate messages too.
16*/
17
18check_out(device)
19int device;
20{
21 register int dev;
22
23 dev = device;
24
25 /* check for device ok */
26 if (!damaged(dev))
27 return (0);
28
29 /* report it as being dead */
30 out(dev);
31
32 /* but if we are docked, we can go ahead anyhow */
33 if (Ship.cond != DOCKED)
34 return (1);
35 printf(" Using starbase %s\n", Device[dev].name);
36 return (0);
37}