-
Notifications
You must be signed in to change notification settings - Fork 2
/
spwarning.c
719 lines (685 loc) · 18.8 KB
/
spwarning.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
#ifdef SHORT_PACKETS
#include "copyright2.h"
#include <stdio.h>
#include <sys/types.h>
#include <math.h>
#include <errno.h>
#include "netrek.h"
#include "sp.h"
#include "wtext.h" /* here are all warnings */
/* SP_S_WARNING vari texte */
static char *s_texte[256]; /* Better with a malloc scheme */
static char no_memory[] = {"Not enough memory for warning string!"};
static
char *whydeadmess[] = { "", "", "[photon]", "[phaser]", "", "[explos]",
"", "", "", "", "", "[plasma]", "[detted]", "[chain]",
"[TEAM]", "", "[detted]", "[chain]", "[?]"};
#define MAX_WHYDEAD (sizeof(whydeadmess)/sizeof(char *))
/* For INL Server */
static
char *shiptype[NUM_TYPES] =
{"SC", "DD", "CA", "BB", "AS", "SB", "GA", "AT"};
#if __STDC__ || defined(__cplusplus)
#define P_(s) s
#else
#define P_(s) ()
#endif
static void killmesg P_((struct warning_s_spacket *packet, char *buf, int shipt, int karg3, int karg4, int karg5));
#undef P_
void
handleSWarning(packet)
struct warning_s_spacket *packet;
{
char buf[256];
register char *bp = buf;
register struct player *target;
register int damage;
register unsigned char w, ar1, ar2;
static int arg3, arg4; /* Here are the arguments for warnings with
* more than 2 arguments */
static int karg3, karg4, karg5;
/* with a little work we can eliminate identical warning message floods
for phaser-recharge, 8-torp-limit, beaming up/down, bombing, etc. */
static int last_udc, lw, lar1,lar2,lar3,lar4;
#define MESG_IDENT_INTERVAL (w == lw && udcounter - last_udc < 5)
w = packet->whichmessage;
ar1 = packet->argument;
ar2 = packet->argument2;
switch (w) {
case TEXTE: /* damage used as tmp var */
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1 && ar2 == lar2){
return;
}
}
damage = (unsigned char) ar1;
damage |= (unsigned char) ar2 << 8;
if (damage >= 0 && damage < NUMWTEXTS)
warning(w_texts[damage]);
lar1 = ar1;
lar2 = ar2;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case PHASER_HIT_TEXT:
last_udc = udcounter;
lw = packet->whichmessage;
target = &players[(unsigned char) ar1 & 0x3f];
damage = (unsigned char) ar2;
if ((unsigned char) ar1 & 64)
damage |= 256;
if ((unsigned char) ar1 & 128)
damage |= 512;
if(phaserWindow){
if(W_WindowWidth(phaserwin) <= 13){
bp = itoa(bp, damage, 3, 0);
bp = strcpy_return(bp, " pts on ");
bp = strcpyp_return(bp, target->p_mapchars, 2);
W_WriteText(phaserwin, 0, 0, textColor, buf, bp-buf, W_MesgFont);
W_FlushScrollingWindow(phaserwin);
if(reportPhaserInReview){
W_WriteText(reviewWin, 0, 0, textColor, buf, bp-buf, W_MesgFont);
W_FlushScrollingWindow(reviewWin);
}
break;
}
else if(W_WindowWidth(phaserwin) <= 32){
bp = itoa(bp, damage, 3, 0);
bp = strcpy_return(bp, " pts on ");
bp = strcpy_return(bp, target->p_name);
*bp ++ = ' ';
*bp ++ = '(';
bp = strcpyp_return(bp, target->p_mapchars, 2);
*bp ++ = ')';
W_WriteText(phaserwin, 0, 0, textColor, buf, bp-buf, W_MesgFont);
W_FlushScrollingWindow(phaserwin);
if(reportPhaserInReview){
W_WriteText(reviewWin, 0, 0, textColor, buf, bp-buf, W_MesgFont);
W_FlushScrollingWindow(reviewWin);
}
break;
}
}
bp = strcpy_return(bp, "Phaser burst hit ");
bp = strcpy_return(bp, target->p_name);
*bp ++ = ' ';
*bp ++ = '(';
bp = strcpyp_return(bp, target->p_mapchars, 2);
*bp ++ = ')';
bp = strcpy_return(bp, " for ");
bp = itoa(bp, damage, 3, 0);
bp = strcpy_return(bp, " points.");
*bp = 0;
if(phaserWindow){
W_WriteText(phaserwin, 0, 0, textColor, buf, bp-buf, W_MesgFont);
W_FlushScrollingWindow(phaserwin);
}
else{
if(phas_msgi)
W_WriteText(messwi, 0, 0, textColor, buf, bp-buf, W_MesgFont);
else
warning(buf);
}
if(reportPhaserInReview){
W_WriteText(reviewWin, 0, 0, textColor, buf, bp-buf, W_MesgFont);
W_FlushScrollingWindow(reviewWin);
}
break;
case BOMB_INEFFECTIVE:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
bp = strcpy_return(bp, "Weapons Officer: Bombing is ineffective for ");
bp = itoa(bp, (int)ar1, 3, 0);
bp = strcpy_return(bp, " armies.");
*bp = 0;
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BOMB_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1 && ar2 == lar2){
return;
}
}
bp = strcpy_return(bp, "Bombing ");
bp = strcpy_return(bp, planets[(unsigned char)ar1].pl_name);
bp = strcpy_return(bp, ". Sensors read ");
bp = itoa(bp, (unsigned int)ar2, 3, 0);
bp = strcpy_return(bp, " armies left.");
*bp = 0;
warning(buf);
lar1 = ar1;
lar2 = ar2;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BEAMUP_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "%s: Too few armies to beam up",
planets[(unsigned char) ar1].pl_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BEAMUP2_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1 && ar2 == lar2){
return;
}
}
sprintf(buf, "Beaming up. (%d/%d)", (unsigned char) ar1,
(unsigned char) ar2);
warning(buf);
lar1 = ar1;
lar2 = ar2;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BEAMUPSTARBASE_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "Starbase %s: Too few armies to beam up",
players[ar1].p_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BEAMDOWNSTARBASE_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "No more armies to beam down to Starbase %s.",
players[ar1].p_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BEAMDOWNPLANET_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "No more armies to beam down to %s.",
planets[(unsigned char) ar1].pl_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SBREPORT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "Transporter Room: Starbase %s reports all troop bunkers are full!",
players[ar1].p_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case ONEARG_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
if (ar1 < NUMVARITEXTS) {
sprintf(buf, vari_texts[ar1], (unsigned char) ar2);
warning(buf);
}
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case BEAM_D_PLANET_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1 && ar2 == lar2 && arg3 == lar3 && arg4 == lar4){
return;
}
}
sprintf(buf, "Beaming down. (%d/%d) %s has %d armies left",
arg3,
arg4,
planets[(unsigned char) ar1].pl_name, ar2);
warning(buf);
lar1 = ar1;
lar2 = ar2;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case ARGUMENTS:
arg3 = lar3 = (unsigned char) ar1;
arg4 = lar4 = (unsigned char) ar2;
break;
case BEAM_U_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1 && ar2 == lar2 && arg3 == lar3 && arg4 == lar4){
return;
}
}
sprintf(buf, "Transfering ground units. (%d/%d) Starbase %s has %d armies left",
(unsigned char) arg3, (unsigned char) arg4, players[ar1].p_name, (unsigned char) ar2);
warning(buf);
lar1 = ar1;
lar2 = ar2;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case LOCKPLANET_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "Locking onto %s", planets[(unsigned char) ar1].pl_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case LOCKPLAYER_TEXT:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "Locking onto %s", players[(unsigned char) ar1].p_name);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SBRANK_TEXT:
sprintf(buf, "You need a rank of %s or higher to command a starbase!", ranks[ar1].name);
warning(buf);
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SBDOCKREFUSE_TEXT:
sprintf(buf, "Starbase %s refusing us docking permission captain.",
players[ar1].p_name);
warning(buf);
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SBDOCKDENIED_TEXT:
sprintf(buf, "Starbase %s: Permission to dock denied, all ports currently occupied.", players[ar1].p_name);
warning(buf);
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SBLOCKSTRANGER:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "Locking onto %s (%c%c)",
players[ar1].p_name,
teamlet[players[ar1].p_team],
shipnos[players[ar1].p_no]);
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SBLOCKMYTEAM:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
sprintf(buf, "Locking onto %s (%c%c) (docking is %s)",
players[ar1].p_name,
teamlet[players[ar1].p_team],
shipnos[players[ar1].p_no],
(players[ar1].p_flags & PFDOCKOK) ? "enabled" : "disabled");
warning(buf);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case DMKILL:
killmesg(packet, buf, 1, karg3, karg4, karg5);
last_udc = udcounter;
lw = packet->whichmessage;
break;
case KILLARGS:
karg3 = (unsigned char) ar1;
karg4 = (unsigned char) ar2;
break;
case KILLARGS2:
karg5 = (unsigned char) ar1;
if(karg5 < 0 || karg5 > MAX_WHYDEAD-1) karg5 = MAX_WHYDEAD-1;
break;
case DMKILLP:
{
struct mesg_spacket msg;
(void) sprintf(msg.mesg, "GOD->ALL %s (%c%c) killed by %s (%c)",
players[ar1].p_name,
teamlet[players[ar1].p_team],
shipnos[ar1],
planets[(unsigned char) ar2].pl_name,
teamlet[planets[(unsigned char) ar2].pl_owner]);
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_flags = MALL | MVALID | MKILLP;
msg.m_recpt = 0;
msg.m_from = 255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case DMBOMB:
{
struct mesg_spacket msg;
char buf1[80];
(void) sprintf(buf, "%-3s->%-3s",
planets[(unsigned char) ar2].pl_name,
teamshort[planets[(unsigned char) ar2].pl_owner]);
(void) sprintf(buf1, "Bombed by %s %c%c who is %d%% damaged.",
players[ar1].p_name,
teamlet[players[ar1].p_team],
shipnos[ar1],
arg3);
(void) sprintf(msg.mesg, "%s %s", buf, buf1);
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_flags = MTEAM | MVALID | MBOMB;
msg.m_recpt = planets[(unsigned char) ar2].pl_owner;
msg.m_from = 255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case DMDEST:
{
struct mesg_spacket msg;
char buf1[80];
(void) sprintf(buf, "%s destroyed by %s (%c%c)",
planets[(unsigned char) ar1].pl_name,
players[ar2].p_name,
teamlet[players[ar2].p_team],
shipnos[(unsigned char) ar2]);
(void) sprintf(buf1, "%-3s->%-3s",
planets[(unsigned char) ar1].pl_name, teamshort[planets[(unsigned char) ar1].pl_owner]);
(void) sprintf(msg.mesg, "%s %s", buf1, buf);
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_flags = MTEAM | MVALID | MDEST;
msg.m_recpt = planets[(unsigned char) ar1].pl_owner;
msg.m_from = 255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case DMTAKE:
{
struct mesg_spacket msg;
char buf1[80];
(void) sprintf(buf, "%s taken over by %s (%c%c)",
planets[(unsigned char) ar1].pl_name,
players[ar2].p_name,
teamlet[players[ar2].p_team],
shipnos[ar2]);
(void) sprintf(buf1, "%-3s->%-3s",
planets[(unsigned char) ar1].pl_name, teamshort[players[ar2].p_team]);
(void) sprintf(msg.mesg, "%s %s", buf1, buf);
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_flags = MTEAM | MVALID | MTAKE;
msg.m_recpt = players[ar2].p_team;
msg.m_from = 255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case DGHOSTKILL:
{
struct mesg_spacket msg;
ushort damage;
damage = (unsigned char) karg3;
damage |= (unsigned char) (karg4 & 0xff) << 8;
(void) sprintf(msg.mesg, "GOD->ALL %s (%c%c) was kill %0.2f for the GhostBusters",
players[(unsigned char) ar1].p_name, teamlet[players[(unsigned char) ar1].p_team],
shipnos[(unsigned char) ar1],
(float) damage / 100.0);
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_flags = MALL | MVALID;
msg.m_recpt = 0;
msg.m_from = 255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
/* INL Daemon Mesages */
case INLDMKILLP:
{
struct mesg_spacket msg;
buf[0] = 0;
if (arg3) { /* Armies */
sprintf(buf, "+%d", arg3);
}
(void) sprintf(msg.mesg, "GOD->ALL %s(%s) (%c%c%s) killed by %s (%c)",
players[(unsigned char) ar1].p_name,
shiptype[players[(unsigned char) ar1].p_ship.s_type],
teamlet[players[(unsigned char) ar1].p_team],
shipnos[(unsigned char) ar1],
buf,
planets[(unsigned char) ar2].pl_name,
teamlet[planets[(unsigned char) ar2].pl_owner]);
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_flags = MALL | MVALID | MKILLP;
msg.m_recpt = 0;
msg.m_from = 255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case INLDMKILL:
killmesg(packet, buf, 1, karg3, karg4, karg5);
last_udc = udcounter;
lw = packet->whichmessage;
break;
case INLDRESUME:
{
struct mesg_spacket msg;
sprintf(msg.mesg, " Game will resume in %d seconds",
(unsigned char)ar1);
msg.m_flags=MALL|MVALID;
msg.type=SP_MESSAGE;
msg.mesg[79]='\0';
msg.m_recpt=0;
msg.m_from=255;
handleMessage(&msg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case INLDTEXTE:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
if (ar1 < NUMDAEMONTEXTS) {
struct mesg_spacket msg;
strcpy(msg.mesg, daemon_texts[(unsigned char) ar1]);
msg.m_flags = MALL | MVALID;
msg.type = SP_MESSAGE;
msg.mesg[79] = '\0';
msg.m_recpt = 0;
msg.m_from = 255;
handleMessage(&msg);
}
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case STEXTE:
if(MESG_IDENT_INTERVAL){
if(ar1 == lar1){
return;
}
}
warning(s_texte[(unsigned char) ar1]);
lar1 = ar1;
last_udc = udcounter;
lw = packet->whichmessage;
break;
case SHORT_WARNING:
{
struct warning_spacket *warn = (struct warning_spacket *) packet;
warning(warn->mesg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
case STEXTE_STRING:
{
struct warning_spacket *warn = (struct warning_spacket *) packet;
warning(warn->mesg);
s_texte[(unsigned char) warn->pad2] = (char *)malloc(warn->pad3 - 4);
if (s_texte[(unsigned char) warn->pad2] == NULL) {
s_texte[(unsigned char) warn->pad2] = no_memory;
warning("Could not add warning! (No memory!)");
} else
strcpy(s_texte[(unsigned char) warn->pad2], warn->mesg);
}
last_udc = udcounter;
lw = packet->whichmessage;
break;
default:
warning("Unknown short message!");
fprintf(stderr, "Unknown short message: %d\n", packet->whichmessage);
last_udc = udcounter;
lw = packet->whichmessage;
break;
}
}
static void
killmesg(packet, buf, shipt, karg3, karg4, karg5)
struct warning_s_spacket *packet;
char *buf;
int shipt;
int karg3,karg4,karg5;
{
register char *bp = buf;
struct mesg_spacket msg;
int killer, victim, armies, damage;
float kills;
victim = (unsigned char) packet->argument & 0x3f;
killer = (unsigned char) packet->argument2 & 0x3f;
/* that's only a temp */
damage = (unsigned char) karg3;
damage |= (karg4 & 127) << 8;
kills = damage / 100.0;
armies = (((unsigned char) packet->argument >> 6) | ((unsigned char) packet->argument2 & 192) >> 4);
if (karg4 & 128)
armies |= 16;
bp = strcpy_return(bp, "GOD->ALL ");
if(abbr_kmesg)
bp = strcpyp_return(bp, players[victim].p_name, 13);
else
bp = strcpy_return(bp, players[victim].p_name);
if(shipt){
*bp++ = ' ';
*bp++ = '[';
bp = strcpy_return(bp, shiptype[players[victim].p_ship.s_type]);
*bp++ = ']';
}
*bp++ = ' ';
*bp++ = '(';
*bp++ = teamlet[players[victim].p_team];
*bp++ = shipnos[victim];
if(armies){
*bp++ = '+';
if(abbr_kmesg){
char tbuf[10];
char *s = tbuf;
s = itoa(s, armies, 2, 0);
*s ++ = ')';
*s ++ = ' ';
bp = strcpyp_return(bp, tbuf, 3);
}
else{
bp = itoa(bp, armies, 3, 0);
bp = strcpy_return(bp, " armies)");
}
msg.m_flags = MALL | MVALID | MKILLA;
}
else{
msg.m_flags = MALL | MVALID | MKILL;
if(abbr_kmesg){
bp = strcpy_return(bp, ") ");
}
else
*bp++ = ')';
}
if(abbr_kmesg){
*bp ++ = ':';
}
else
bp = strcpy_return(bp, " was kill ");
bp = itof32(bp, kills);
bp = strcpy_return(bp, " for ");
if(abbr_kmesg)
bp = strcpyp_return(bp, players[killer].p_name, 13);
else
bp = strcpy_return(bp, players[killer].p_name);
if(shipt){
*bp++ = ' ';
*bp++ = '[';
bp = strcpy_return(bp, shiptype[players[killer].p_ship.s_type]);
*bp++ = ']';
}
*bp++ = ' ';
*bp++ = '(';
*bp++ = teamlet[players[killer].p_team];
*bp++ = shipnos[killer];
*bp++ = ')';
*bp = 0;
#ifdef FEATURE
if(F_why_dead){
*bp ++ = ' ';
bp = strcpy_return(bp, whydeadmess[karg5]);
*bp = 0;
karg5 = 0;
}
#endif
msg.type = SP_MESSAGE;
strncpy(msg.mesg, buf, 79);
msg.mesg[79] = '\0';
msg.m_recpt = 0;
msg.m_from = 255;
handleMessage(&msg);
}
#endif