annotate smessage.c @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* $Id: smessage.c,v 1.1.1.1 1997/12/06 05:41:31 darius Exp $ */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 * smessage.c
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 #include "copyright.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 #include <stdio.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #include <math.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10 #include <signal.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 #include <string.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include <ctype.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #include "struct.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 #include "data.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 #include "proto.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 #include "gameconf.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20 #define ADDRLEN 10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 #define M_XOFF 5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 #ifndef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 #define M_YOFF 5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 #define M_YOFF 1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 #define MSGLEN 80
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 /* XFIX */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 #define BLANKCHAR(col, n) W_ClearArea(messagew, M_XOFF+W_Textwidth*(col), \
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 M_YOFF, W_Textwidth * (n), W_Textheight);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 #define DRAWCURSOR(col) W_WriteText(messagew, M_XOFF+W_Textwidth*(col), \
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 M_YOFF, textColor, &cursor, 1, W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 static int lcount;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 static char buf[MSGLEN];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 static char cursor = '_';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 char addr, *addr_str;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 /* Prototypes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 static void smessage_first P((int ichar));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 /*static*/ char *getaddr P((int who));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 /*static*/ char *getaddr2 P((int flags, int recip));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48 message_expose()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 if (!messpend)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 W_WriteText(messagew, M_XOFF, M_YOFF, textColor, addr_str,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 strlen(addr_str), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 W_WriteText(messagew, M_XOFF + ADDRLEN * W_Textwidth, M_YOFF, textColor,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 buf, lcount - ADDRLEN, W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 DRAWCURSOR(lcount);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 smessage_ahead(head, ichar)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 char head;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 char ichar;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 if (messpend == 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 smessage_first(head);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 smessage(ichar);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 smessage_first(ichar)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 char ichar;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 messpend = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 /* clear out message window in case messages went there */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 W_ClearWindow(messagew);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 if (mdisplayed) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 BLANKCHAR(0, lastcount);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 mdisplayed = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 /* Put the proper recipient in the window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 if (/*(ichar == 't') || */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 /* that's a player number! */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 /* YUCK! */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 (ichar == 'T'))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 addr = teaminfo[me->p_teami].letter;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 addr = ichar;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 addr_str = getaddr(addr);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92 if (addr_str == 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 /* print error message */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 messpend = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95 #ifdef NOWARP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96 message_off();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98 W_WarpPointer(NULL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 W_WriteText(messagew, M_XOFF, M_YOFF, textColor, addr_str,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102 strlen(addr_str), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103 lcount = ADDRLEN;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104 DRAWCURSOR(ADDRLEN);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 smessage(ichar)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110 int ichar;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112 register int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 char twochar[2], *delim;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 if (messpend == 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116 if(lowercaset && ichar == 't')
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 ichar='T';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118 else if(lowercaset && (ichar == 'T'))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 ichar='t';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 smessage_first(ichar);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 switch (ichar) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124 case '\b': /* character erase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 case '\177':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 if (--lcount < ADDRLEN) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127 lcount = ADDRLEN;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130 BLANKCHAR(lcount + 1, 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131 DRAWCURSOR(lcount);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134 case 'w'+256: /* word erase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 i = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136 /* back up over blanks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 while (--lcount >= ADDRLEN &&
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138 isspace((unsigned char) buf[lcount - ADDRLEN] & ~(0x80)))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 i++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 lcount++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 /* back up over non-blanks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 while (--lcount >= ADDRLEN &&
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 !isspace((unsigned char) buf[lcount - ADDRLEN] & ~(0x80)))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 i++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145 lcount++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 if (i > 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 BLANKCHAR(lcount, i + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 DRAWCURSOR(lcount);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153 case 'u'+256: /* kill line */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 case 'x'+256:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 if (lcount > ADDRLEN) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 BLANKCHAR(ADDRLEN, lcount - ADDRLEN + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 lcount = ADDRLEN;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158 DRAWCURSOR(ADDRLEN);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 case '\033': /* abort message */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163 BLANKCHAR(0, lcount + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164 mdisplayed = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 messpend = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 #ifdef NOWARP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 message_off();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 W_WarpPointer(NULL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173 case '\r': /* send message */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174 buf[lcount - ADDRLEN] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 messpend = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176 sendCharMessage(buf, addr);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 BLANKCHAR(0, lcount + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178 mdisplayed = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179 lcount = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 default: /* add character */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 if (lcount >= 79) { /* send mesg and continue mesg */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184 if (addr == 'M')
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185 if ((delim = strchr(buf, '>') + 1) == NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 W_Beep();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189 else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190 i = delim - buf;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 buf[lcount - ADDRLEN + 1] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192 sendCharMessage(buf, addr);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 memset(delim, '\0', sizeof(buf) - i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 BLANKCHAR(i, lcount + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195 W_WriteText(messagew, M_XOFF, M_YOFF, textColor,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 addr_str, strlen(addr_str), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 W_WriteText(messagew, M_XOFF+(strlen(addr_str) +
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198 1) * W_Textwidth,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199 M_YOFF, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 lcount = i + ADDRLEN;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 DRAWCURSOR(i + ADDRLEN);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204 buf[lcount - ADDRLEN + 1] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 sendCharMessage(buf, addr);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 BLANKCHAR(0, lcount + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 W_WriteText(messagew, M_XOFF, M_YOFF, textColor, addr_str,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208 strlen(addr_str), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 lcount = ADDRLEN;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 DRAWCURSOR(ADDRLEN);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 if (ichar > 255)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 twochar[0] = ichar;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 twochar[1] = cursor;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217 W_WriteText(messagew, M_XOFF + W_Textwidth * lcount, M_YOFF,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 textColor, twochar, 2, W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219 buf[(lcount++) - ADDRLEN] = ichar;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 sendCharMessage(buf, ch)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226 char *buf;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 int ch;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229 char tmp[MSGLEN], *delim;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 int i, count;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 /* uses ch to find out what kind of message it is and then sends
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 it there */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 switch ((char) ch) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 case 'A':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 pmessage(buf, 0, MALL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 case 'F':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
239 pmessage(buf, FEDm, MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
240 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
241 case 'R':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
242 pmessage(buf, ROMm, MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
243 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
244 case 'K':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
245 pmessage(buf, KLIm, MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
246 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
247 case 'O':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
248 pmessage(buf, ORIm, MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
249 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
250 case 'G':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
251 pmessage(buf, 0, MGOD);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
252 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
253 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
254 case '!':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
255 pmessage(buf, 0, MTOOLS);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
256 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
257 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
258 case 'T':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
259 pmessage(buf, idx_to_mask(me->p_teami), MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
260 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
261 case 'M':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
262 /* mcast format: hit M and list of target addresses followed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
263 /* by greater than(>) and message. the entire mesg including */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
264 /* addresses will be sent to each address */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
265 if((delim = strchr(buf, '>')) != NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
266 count = delim - buf; /* number of addresses */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
267 strncpy(tmp, buf, count);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
268 if(strchr(tmp, ' ') == NULL)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
269 for(i=0; i < count; i++) { /* dont do tmp[0] is M */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
270 sendCharMessage(buf, tmp[i]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
271 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
272 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
273 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
274 case '0':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
275 case '1':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
276 case '2':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
277 case '3':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
278 case '4':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
279 case '5':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
280 case '6':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
281 case '7':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
282 case '8':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
283 case '9':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
284 pmessage(buf, ch - '0', MINDIV);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
285 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
286 case 'a':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
287 case 'b':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
288 case 'c':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
289 case 'd':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
290 case 'e':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
291 case 'f':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
292 case 'g':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
293 case 'h':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
294 case 'i':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
295 case 'j':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
296 case 'k':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
297 case 'l':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
298 case 'm':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
299 case 'n':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
300 case 'o':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
301 case 'p':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
302 case 'q':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
303 case 'r':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
304 case 's':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
305 case 't':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
306 case 'u':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
307 case 'v':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
308 case 'w':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
309 case 'x':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
310 case 'y':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
311 case 'z':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
312 pmessage(buf, ch - 'a' + 10, MINDIV);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
313 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
314 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
315 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
316 int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
317 for (i = 0; i < number_of_teams; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
318 if (ch == teaminfo[i].letter)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
319 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
320 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
321 if (i < number_of_teams) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
322 pmessage(buf, idx_to_mask(i), MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
323 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
324 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
325 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
326 warning("Not legal recipient");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
327 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
328 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
329
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
330 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
331 pmessage(str, recip, group)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
332 char *str;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
333 int recip;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
334 int group;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
335 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
336 char newbuf[100];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
337
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
338 strcpy(lastMessage, str);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
339 switch(group) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
340 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
341 case MTOOLS:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
342 sendTools(str);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
343 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
344 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
345 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
346 sendMessage(str, group, recip);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
347 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
348 if ((group == MTEAM && recip != idx_to_mask(me->p_teami)) ||
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
349 (group == MINDIV && recip != me->p_no)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
350 sprintf(newbuf, "%s %s",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
351 getaddr2(group, (group == MTEAM) ?
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
352 mask_to_idx(recip) : recip),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
353 str);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
354 newbuf[79] = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
355 dmessage(newbuf, group, me->p_no, recip);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
356 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
357 #ifdef NOWARP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
358 message_off();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
359 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
360 W_WarpPointer(NULL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
361 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
362 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
363
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
364 /*static */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
365 char *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
366 getaddr(who)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
367 char who;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
368 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
369 switch (who) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
370 case 'A':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
371 return (getaddr2(MALL, 0));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
372 case 'F':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
373 return (getaddr2(MTEAM, FEDi));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
374 case 'R':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
375 return (getaddr2(MTEAM, ROMi));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
376 case 'K':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
377 return (getaddr2(MTEAM, KLIi));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
378 case 'O':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
379 return (getaddr2(MTEAM, ORIi));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
380 case 'G':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
381 return (getaddr2(MGOD, 0));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
382 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
383 case '!':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
384 return (getaddr2(MTOOLS, 0));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
385 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
386 case 'M':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
387 return (getaddr2(MCAST, 0));;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
388 case '0':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
389 case '1':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
390 case '2':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
391 case '3':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
392 case '4':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
393 case '5':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
394 case '6':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
395 case '7':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
396 case '8':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
397 case '9':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
398 if (isPlaying(&players[who - '0'])) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
399 return (getaddr2(MINDIV, who - '0'));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
400 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
401 warning("Player is not in game");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
402 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
403 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
404 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
405 case 'a':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
406 case 'b':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
407 case 'c':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
408 case 'd':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
409 case 'e':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
410 case 'f':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
411 case 'g':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
412 case 'h':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
413 case 'i':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
414 case 'j':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
415 case 'k':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
416 case 'l':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
417 case 'm':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
418 case 'n':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
419 case 'o':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
420 case 'p':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
421 case 'q':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
422 case 'r':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
423 case 's':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
424 case 't':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
425 case 'u':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
426 case 'v':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
427 case 'w':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
428 case 'x':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
429 case 'y':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
430 case 'z':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
431 if (who - 'a' + 10 > nplayers) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
432 warning("Invalid player number");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
433 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
434 } else if (isPlaying(&players[who - 'a' + 10])) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
435 return (getaddr2(MINDIV, who - 'a' + 10));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
436 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
437 warning("Player is not in game");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
438 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
439 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
440 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
441 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
442 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
443 int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
444 for (i = 0; i < number_of_teams; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
445 if (addr == teaminfo[i].letter)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
446 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
447 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
448 if (i < number_of_teams) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
449 return getaddr2(MTEAM, i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
450 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
451 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
452 warning("Not legal recipient");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
453 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
454 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
455 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
456
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
457 /*static*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
458 char *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
459 getaddr2(flags, recip)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
460 int flags;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
461 int recip;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
462 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
463 static char addrmesg[ADDRLEN];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
464
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
465 (void) sprintf(addrmesg, " %c%c->", teaminfo[me->p_teami].letter, shipnos[me->p_no]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
466 switch (flags) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
467 case MALL:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
468 (void) sprintf(&addrmesg[5], "ALL");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
469 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
470 case MTEAM:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
471 (void) sprintf(&addrmesg[5], teaminfo[recip].shortname);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
472 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
473 case MINDIV:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
474 (void) sprintf(&addrmesg[5], "%c%c ",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
475 teaminfo[players[recip].p_teami].letter, shipnos[recip]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
476 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
477 case MGOD:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
478 (void) sprintf(&addrmesg[5], "GOD");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
479 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
480 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
481 case MTOOLS:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
482 (void) sprintf(addrmesg, " Shell>");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
483 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
484 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
485 case MCAST:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
486 (void) sprintf(&addrmesg[5], "MCAS");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
487 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
488
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
489 return (addrmesg);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
490 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
491
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
492 /* Used in NEWMACRO, useful elsewhere also */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
493 int
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
494 getgroup(addr, recip)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
495 char addr;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
496 int *recip;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
497 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
498 *recip = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
499
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
500 switch (addr) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
501 case 'A':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
502 *recip = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
503 return (MALL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
504 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
505 case 'T': /* had to add this...why didn't COW-lite need
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
506 it?? -JR */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
507 *recip = idx_to_mask(me->p_teami);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
508 return (MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
509 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
510 case 'F':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
511 *recip = FEDm;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
512 return (MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
513 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
514 case 'R':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
515 *recip = ROMm;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
516 return (MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
517 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
518 case 'K':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
519 *recip = KLIm;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
520 return (MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
521 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
522 case 'O':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
523 *recip = ORIm;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
524 return (MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
525 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
526 case 'G':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
527 *recip = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
528 return (MGOD);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
529 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
530 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
531 case '!':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
532 *recip = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
533 return (MTOOLS);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
534 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
535 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
536 case 'M':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
537 *recip = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
538 return (MMOO);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
539 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
540 case '0':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
541 case '1':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
542 case '2':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
543 case '3':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
544 case '4':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
545 case '5':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
546 case '6':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
547 case '7':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
548 case '8':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
549 case '9':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
550 if (players[addr - '0'].p_status == PFREE) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
551 warning("That player left the game. message not sent.");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
552 return 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
553 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
554 *recip = addr - '0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
555 return (MINDIV);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
556 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
557 case 'a':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
558 case 'b':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
559 case 'c':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
560 case 'd':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
561 case 'e':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
562 case 'f':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
563 case 'g':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
564 case 'h':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
565 case 'i':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
566 case 'j':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
567 case 'k':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
568 case 'l':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
569 case 'm':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
570 case 'n':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
571 case 'o':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
572 case 'p':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
573 case 'q':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
574 case 'r':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
575 case 's':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
576 case 't':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
577 case 'u':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
578 case 'v':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
579 case 'w':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
580 case 'x':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
581 case 'y':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
582 case 'z':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
583 if (players[addr - 'a' + 10].p_status == PFREE) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
584 warning("That player left the game. message not sent.");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
585 return 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
586 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
587 *recip = addr - 'a' + 10;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
588 return (MINDIV);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
589 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
590 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
591 warning("Not legal recipient");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
592 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
593 return 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
594 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
595
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
596
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
597
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
598
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
599
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
600 /*-------------------------------EMERGENCY--------------------------------*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
601 /* This function sends a distress message out to the player's team. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
602 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
603 emergency()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
604 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
605 char ebuf[120]; /* to sprintf into */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
606 char buf2[20];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
607
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
608 sprintf(ebuf, "Distress %c%c", /* get team and end */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
609 teaminfo[me->p_teami].letter, shipnos[me->p_no]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
610 switch (myship->s_type) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
611 case STARBASE:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
612 strcat(ebuf, " (Starbase): ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
613 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
614 case WARBASE:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
615 strcat(ebuf, " (Warbase): ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
616 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
617 case JUMPSHIP:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
618 strcat(ebuf, " (Jumpship): ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
619 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
620 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
621 strcat(ebuf, ": ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
622 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
623 if (me->p_damage != 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
624 if (me->p_damage > me->p_ship->s_maxdamage - 30)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
625 sprintf(buf2, "DEAD MAN ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
626 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
627 sprintf(buf2, "damg: %d%% ", (100 * me->p_damage) / me->p_ship->s_maxdamage);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
628 strcat(ebuf, buf2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
629 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
630 if (me->p_shield < me->p_ship->s_maxshield) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
631 if (me->p_shield < 5)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
632 sprintf(buf2, "NO SHIELDS ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
633 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
634 sprintf(buf2, "shld: %d%% ", (100 * me->p_shield) / me->p_ship->s_maxshield);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
635 strcat(ebuf, buf2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
636 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
637 if (me->p_wtemp > 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
638 if (me->p_flags & PFWEP)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
639 sprintf(buf2, "WTEMP ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
640 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
641 sprintf(buf2, "W %d%% ", (100 * me->p_wtemp) / me->p_ship->s_maxwpntemp);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
642 strcat(ebuf, buf2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
643 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
644 if (me->p_etemp > 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
645 if (me->p_flags & PFENG)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
646 sprintf(buf2, "ETEMP ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
647 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
648 sprintf(buf2, "E %d%% ", (100 * me->p_etemp) / me->p_ship->s_maxegntemp);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
649 strcat(ebuf, buf2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
650 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
651 if (me->p_fuel < me->p_ship->s_maxfuel) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
652 if (me->p_fuel < 400)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
653 sprintf(buf2, "NO FUEL ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
654 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
655 sprintf(buf2, "F %d%% ", (100 * me->p_fuel) / me->p_ship->s_maxfuel);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
656 strcat(ebuf, buf2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
657 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
658 if ((int) strlen(ebuf) < 12)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
659 strcat(ebuf, " perfect health ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
660 if (me->p_armies > 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
661 sprintf(buf2, "%d ARMIES!", me->p_armies);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
662 strcat(ebuf, buf2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
663 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
664 pmessage(ebuf, idx_to_mask(me->p_teami), MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
665 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
666
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
667
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
668
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
669 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
670 carry_report()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
671 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
672 char ebuf[MSGLEN], *pntr;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
673 double dist, closedist;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
674 struct planet *k, *p = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
675
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
676 closedist = blk_gwidth;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
677
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
678 for (k = &planets[0]; k < &planets[nplanets]; k++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
679 dist = hypot((double) (me->p_x - k->pl_x),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
680 (double) (me->p_y - k->pl_y));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
681 if (dist < closedist) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
682 p = k;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
683 closedist = dist;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
684 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
685 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
686 if (myship->s_type == STARBASE)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
687 sprintf(ebuf, "Your Starbase is carrying %d armies. ", me->p_armies);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
688 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
689 sprintf(ebuf, "I am carrying %d armies. ", me->p_armies);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
690 for (pntr = ebuf; *pntr; pntr++);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
691 if (paradise) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
692 sprintf(pntr, "Sector: %d-%d ", (me->p_x / GRIDSIZE) + 1,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
693 (me->p_y / GRIDSIZE) + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
694 for (; *pntr; pntr++);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
695 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
696 sprintf(pntr, "%sear %s", (me->p_flags & PFCLOAK) ? "Cloaked n" : "N",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
697 p->pl_name);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
698 pmessage(ebuf, idx_to_mask(me->p_teami), MTEAM);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
699 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
700
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
701 #ifdef NOWARP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
702 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
703 message_on()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
704 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
705 if (warp) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
706 W_WarpPointer(messagew);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
707 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
708 #ifdef TCURSORS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
709 else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
710 messageon = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
711 W_DefineTextCursor(w);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
712 W_DefineTextCursor(mapw);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
713 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
714 #endif /* TCURSORS */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
715 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
716
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
717 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
718 message_off()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
719 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
720 #ifdef TCURSORS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
721 if (!warp) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
722 messageon = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
723 W_RevertCursor(w);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
724 W_RevertCursor(mapw);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
725 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
726 #endif /* TCURSORS */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
727 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
728 #endif /* NOWARP */