4
|
1 /*--------------------------------------------------------------------------
|
|
2 NETREK II -- Paradise
|
|
3
|
|
4 Permission to use, copy, modify, and distribute this software and its
|
|
5 documentation, or any derivative works thereof, for any NON-COMMERCIAL
|
|
6 purpose and without fee is hereby granted, provided that this copyright
|
|
7 notice appear in all copies. No representations are made about the
|
|
8 suitability of this software for any purpose. This software is provided
|
|
9 "as is" without express or implied warranty.
|
|
10
|
|
11 Xtrek Copyright 1986 Chris Guthrie
|
|
12 Netrek (Xtrek II) Copyright 1989 Kevin P. Smith
|
|
13 Scott Silvey
|
|
14 Paradise II (Netrek II) Copyright 1993 Larry Denys
|
|
15 Kurt Olsen
|
|
16 Brandon Gillespie
|
|
17 --------------------------------------------------------------------------*/
|
|
18
|
|
19 #include "config.h"
|
|
20 #include "struct.h"
|
|
21 #include "shmem.h"
|
|
22
|
|
23 /*
|
|
24 * This function should be called any time a planet is relocated. It is in
|
|
25 * charge of updating the space grid.
|
|
26 */
|
|
27 void
|
|
28 move_planet(pno, x, y, isold)
|
|
29 int pno; /* planet number */
|
|
30 int x, y;
|
|
31 int isold; /* 0 if the planet has not yet been entered
|
|
32 * into the grid */
|
|
33 {
|
|
34 struct planet *pl = &planets[pno];
|
|
35
|
|
36 if (isold)
|
|
37 {
|
|
38 /* remove from previous space grid position */
|
|
39 }
|
|
40 pl->pl_x = x;
|
|
41 pl->pl_y = y;
|
|
42
|
|
43 /* enter into space grid */
|
|
44 }
|
|
45
|
|
46 void
|
|
47 move_player(pno, x, y, isold)
|
|
48 int pno; /* player number */
|
|
49 int x, y;
|
|
50 int isold; /* 0 if the player has not yet been entered
|
|
51 * into the grid */
|
|
52 {
|
|
53 struct player *pl = &players[pno];
|
|
54
|
|
55 if (isold)
|
|
56 {
|
|
57 }
|
|
58 pl->p_x = x;
|
|
59 pl->p_y = y;
|
|
60
|
|
61 /* enter into space grid */
|
|
62 }
|
|
63
|
|
64 void
|
|
65 move_torp(tno, x, y, isold)
|
|
66 int tno; /* torp number */
|
|
67 int x, y;
|
|
68 int isold; /* 0 if the torp has not yet been entered
|
|
69 * into the grid */
|
|
70 {
|
|
71 struct torp *t = &torps[tno];
|
|
72
|
|
73 if (isold)
|
|
74 {
|
|
75 }
|
|
76 t->t_x = x;
|
|
77 t->t_y = y;
|
|
78
|
|
79 /* enter into space grid */
|
|
80 }
|
|
81
|
|
82 void
|
|
83 move_missile(dno, x, y, isold)
|
|
84 int dno; /* missile number */
|
|
85 int x, y;
|
|
86 int isold; /* 0 if the missile has not yet been entered
|
|
87 * into the grid */
|
|
88 {
|
|
89 struct missile *d = &missiles[dno];
|
|
90
|
|
91 if (isold)
|
|
92 {
|
|
93 }
|
|
94 d->ms_x = x;
|
|
95 d->ms_y = y;
|
|
96
|
|
97 /* enter into space grid */
|
|
98 }
|