Added errno.h to includes.
[unix-history] / usr / src / games / trek / setwarp.c
CommitLineData
bb0cfa24
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
e9fb6bea
KB
3 * All rights reserved.
4 *
b2e7427f 5 * %sccs.include.redist.c%
bb0cfa24
DF
6 */
7
6ce8f7c1 8#ifndef lint
b2e7427f 9static char sccsid[] = "@(#)setwarp.c 5.4 (Berkeley) %G%";
e9fb6bea 10#endif /* not lint */
6ce8f7c1
KM
11
12# include "trek.h"
13# include "getpar.h"
14
15/*
16** SET WARP FACTOR
17**
18** The warp factor is set for future move commands. It is
19** checked for consistancy.
20*/
21
22setwarp()
23{
06d69904 24 double warpfac;
6ce8f7c1
KM
25
26 warpfac = getfltpar("Warp factor");
27 if (warpfac < 0.0)
28 return;
29 if (warpfac < 1.0)
30 return (printf("Minimum warp speed is 1.0\n"));
31 if (warpfac > 10.0)
32 return (printf("Maximum speed is warp 10.0\n"));
33 if (warpfac > 6.0)
34 printf("Damage to warp engines may occur above warp 6.0\n");
35 Ship.warp = warpfac;
36 Ship.warp2 = Ship.warp * warpfac;
37 Ship.warp3 = Ship.warp2 * warpfac;
38}