]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/bot/bot_ed.qc
the frikbot core, slight variable changes to get it to work in nexuiz
[divverent/nexuiz.git] / qcsrc / bot / bot_ed.qc
1 /***********************************************
2 *                                              *
3 *          FrikBot Waypoint Editor             *
4 *   "The 'wtf is this doing in my mod' code"   *
5 *                                              *
6 ***********************************************/
7
8 /*
9
10 This program is in the Public Domain. My crack legal
11 team would like to add:
12
13 RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS"
14 AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE
15 ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR
16 FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN
17 NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY
18 GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL,
19 EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC"
20 SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
21 DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. 
22
23 You accept this software on the condition that you
24 indemnify and hold harmless Ryan "FrikaC" Smith from
25 any and all liability or damages to third parties,
26 including attorney fees, court costs, and other
27 related costs and expenses, arising out of your use
28 of this software irrespective of the cause of said
29 liability. 
30
31 The export from the United States or the subsequent
32 reexport of this software is subject to compliance
33 with United States export control and munitions
34 control restrictions. You agree that in the event you
35 seek to export this software, you assume full
36 responsibility for obtaining all necessary export
37 licenses and approvals and for assuring compliance
38 with applicable reexport restrictions. 
39
40 Any reproduction of this software must contain
41 this notice in its entirety. 
42
43 */
44
45 float saved1, saved2, saved3, scratch1, scratch2, scratch3, scratch4;
46 float bytecounter, filecount;
47
48 float MENU_MAIN                 = 1;
49 float MENU_WAYPOINTS    = 2;
50 float MENU_LINKS                = 3;
51 float MENU_FLAGS                = 4;
52 float MENU_FLAGS2               = 5;
53 float MENU_BOTS                 = 6;
54 float MENU_WAYLIST      = 7;
55 // 8 = link way
56 // 9 = telelink way
57 // 10 = delete link
58 // 11 = create link X2
59 // 12 = delete link x2
60 // 13 = confirmation of delete all
61 // 14 = Teleport to way
62 // 15 = confirmation of delete point
63
64 void() BSPDumpWaypoints;
65 void() QCDumpWaypoints;
66 void() DumpWaypoints;
67 /*
68 // source for the menu strings...
69
70 -- Main Menu --\n
71 [1] >>Waypoint Management\n
72 [2] >>Link Management    \n
73 [3] >>AI Flag Management \n
74 [4] >>Bot Management     \n
75 [5] >>Waylist Management \n
76 [6] [#] Noclip           \n
77 [7] [#] Godmode          \n
78 [8] [#] Hold Select      \n
79 [9] Teleport to Way #    \n
80 [0] Close Menu           \n
81
82 // missing from main is show way info
83 // iffy on the teleport to way thing being on main...seems like either a bot or way list thing
84
85 -- Waypoint Management --\n
86 [1] Move Waypoint        \n
87 [2] Delete Waypoint      \n
88 [3] Make Waypoint        \n
89 [4] Make Way + Link      \n
90 [5] Make Way + Link X2   \n
91 [6] Make Way + Telelink  \n
92 [7] Show waypoint info   \n
93 [8] >>Link Management    \n
94 [9] >>AI Flag Management \n
95 [0] >>Main Menu          \n
96
97 -- Link Management --\n
98 [1] Unlink Waypoint      \n
99 [2] Create Link          \n
100 [3] Create Telelink      \n
101 [4] Delete Link          \n
102 [5] Create Link X2       \n
103 [6] Delete Link X2       \n
104 [7] >Make Waypoint       \n
105 [8] >>Waypoint Management\n
106 [9] >>AI Flag Management \n
107 [0] >>Main Menu          \n
108
109 // Ai flags...ugh
110
111 -- AI Flag Management --\n
112 [1] [#] Door Flag        \n
113 [2] [#] Precision        \n
114 [3] [#] Surface for air  \n
115 [4] [#] Blind mode       \n
116 [5] [#] Jump             \n
117 [6] [#] Dark             \n
118 [7] [#] Super Jump       \n
119 \n
120 [9] >>AI Flags page 2    \n
121 [0] >>Main Menu          \n
122
123 -- AI Flags pg. 2--\n
124 [1] [#] Difficult        \n
125 [2] [#] Wait for plat    \n
126 [3] [#] Ride train       \n
127 [4] [#] Door flag no open\n
128 [5] [#] Ambush           \n
129 [6] [#] Snipe            \n
130 [7] [#] Trace Test       \n
131 \n
132 [9] >>AI Flag Management \n
133 [0] >>Main Menu          \n
134
135 -- Bot Management --\n
136 [1] Add a Test Bot       \n
137 [2] Order Test Bot here  \n
138 [3] Remove Test Bot      \n
139 [4] Stop Test Bot        \n
140 [5] Teleport Bot here    \n
141 [6] Teleport to Way #    \n
142 \n
143 \n
144 \n
145 [0] >>Main Menu          \n 
146
147 -- Waylist Management --\n
148 [1] Delete ALL Waypoints \n
149 [2] Dump Waypoints       \n
150 [3] Check For Errors     \n
151 [4] Save Waypoints       \n
152 [5] [#] Dynamic Mode     \n
153 [6] [#] Dynamic Link     \n
154 [7] [#] WAY output       \n
155 [8] [#] QC output        \n
156 [9] [#] BSP ents output  \n
157 [0] Main Menu            \n
158
159 */
160
161 void() bot_menu_display =
162 {
163 // build options
164         local string s1, s2, s3, s4, s5, s6, s7, h;
165         local entity t;
166
167 // check impulses
168         if (self.impulse > 0 && self.impulse < 11 && self.b_menu)
169         {
170                 if (self.b_menu == MENU_MAIN)
171                 {
172                         if (self.impulse == 1)
173                         {
174                                 self.b_menu = MENU_WAYPOINTS;
175                                 self.b_menu_time = time;
176                         }
177                         else if (self.impulse == 2)
178                         {
179                                 self.b_menu = MENU_LINKS;
180                                 self.b_menu_time = time;
181                         }
182                         else if (self.impulse == 3)
183                         {
184                                 self.b_menu = MENU_FLAGS;
185                                 self.b_menu_time = time;
186                         }
187                         else if (self.impulse == 4)
188                         {
189                                 self.b_menu = MENU_BOTS;
190                                 self.b_menu_time = time;
191                         }
192                         else if (self.impulse == 5)
193                         {
194                                 self.b_menu = MENU_WAYLIST;
195                                 self.b_menu_time = time;
196                         }
197                         else if (self.impulse == 6)
198                         {
199                                 if (self.movetype == MOVETYPE_NOCLIP)
200                                         self.movetype = MOVETYPE_WALK;
201                                 else
202                                         self.movetype = MOVETYPE_NOCLIP;
203                                 self.b_menu_time = time;
204
205                         }
206                         else if (self.impulse == 7)
207                         {
208                                 if (self.flags & FL_GODMODE)
209                                         self.flags = self.flags - FL_GODMODE;
210                                 else
211                                         self.flags = self.flags | FL_GODMODE;
212                                 self.b_menu_time = time;
213
214                         }
215                         else if (self.impulse == 8)
216                         {
217                                 if (self.b_aiflags & AI_HOLD_SELECT)
218                                         self.b_aiflags = self.b_aiflags - AI_HOLD_SELECT;
219                                 else
220                                         self.b_aiflags = self.b_aiflags | AI_HOLD_SELECT;
221                                 self.b_menu_time = time;
222                         }
223                         else if (self.impulse == 9)
224                         {
225                                 self.b_menu = 14;
226                                 self.b_menu_time = time;
227                         }
228                         else if (self.impulse == 10)
229                                 bot_way_edit();
230                 }
231                 else if (self.b_menu == MENU_WAYPOINTS)
232                 {
233                         if (self.impulse == 1)
234                         {
235                                 if (self.current_way)
236                                         setorigin(self.current_way, self.origin + self.view_ofs);
237                         }
238                         else if (self.impulse == 2)
239                         {
240                                 if (self.current_way)
241                                 {
242                                         self.b_menu = 15;
243                                         self.b_menu_time = time;
244                                         self.last_way = self.current_way;
245                                 }
246                         }
247                         else if (self.impulse == 3)
248                         {
249                                 make_waypoint(self.origin + self.view_ofs);
250                         }
251                         else if (self.impulse == 4)
252                         {
253                                 t = make_waypoint(self.origin + self.view_ofs);
254                                 if (!LinkWays(self.current_way, t))
255                                         sprint(self, "Unable to link them\n");
256                         }
257                         else if (self.impulse == 5)
258                         {
259                                 t = make_waypoint(self.origin + self.view_ofs);
260                                 if (!LinkWays(self.current_way, t))
261                                         sprint(self, "Unable to link old to new\n");
262                                 LinkWays(t, self.current_way);
263                         }
264                         else if (self.impulse == 6)
265                         {
266                                 t = make_waypoint(self.origin + self.view_ofs);
267                                 if (!TeleLinkWays(self.current_way, t))
268                                         sprint(self, "Unable to link them\n");
269                         }
270                         else if (self.impulse == 7)
271                         {
272                                 if (self.current_way)
273                                 {
274                                         sprint(self, "\nwaypoint info for waypoint #");
275                                         h = ftos(self.current_way.count);
276                                         sprint(self, h);
277                                         sprint(self, "\nAI Flag value: ");
278                                         h = ftos(self.current_way.b_aiflags);
279                                         sprint(self, h);
280
281                                         if (self.current_way.target1)
282                                         {
283                                                 h = ftos(self.current_way.target1.count);
284                                                 if (self.current_way.b_aiflags & AI_TELELINK_1)
285                                                         sprint(self, "\nTelelink1 to:");
286                                                 else
287                                                         sprint(self, "\nLink1 to:");
288                                                 sprint(self, h);
289                                         }
290                                         if (self.current_way.target2)
291                                         {
292                                                 h = ftos(self.current_way.target2.count);
293                                                 if (self.current_way.b_aiflags & AI_TELELINK_2)
294                                                         sprint(self, "\nTelelink2 to:");
295                                                 else
296                                                         sprint(self, "\nLink2 to:");
297                                                 sprint(self, h);
298                                         }
299                                         if (self.current_way.target3)
300                                         {
301                                                 h = ftos(self.current_way.target3.count);
302                                                 if (self.current_way.b_aiflags & AI_TELELINK_3)
303                                                         sprint(self, "\nTelelink3 to:");
304                                                 else
305                                                         sprint(self, "\nLink3 to:");
306                                                 sprint(self, h);
307                                         }
308                                         if (self.current_way.target4)
309                                         {
310                                                 h = ftos(self.current_way.target4.count);
311                                                 if (self.current_way.b_aiflags & AI_TELELINK_4)
312                                                         sprint(self, "\nTelelink4 to:");
313                                                 else
314                                                         sprint(self, "\nLink4 to:");
315                                                 sprint(self, h);
316                                         }
317                                         sprint(self, "\n\n");
318                                 }
319
320                         }
321                         if (self.impulse == 8)
322                         {
323                                 self.b_menu = MENU_LINKS;
324                                 self.b_menu_time = time;
325                         }
326                         else if (self.impulse == 9)
327                         {
328                                 self.b_menu = MENU_FLAGS;
329                                 self.b_menu_time = time;
330                         }
331                         else if (self.impulse == 10)
332                         {
333                                 self.b_menu = MENU_MAIN;
334                                 self.b_menu_time = time;
335                         }
336                 }
337                 else if (self.b_menu == MENU_LINKS)
338                 {
339                         if (self.impulse == 1)
340                         {
341                                 if (self.current_way)
342                                         self.current_way.target1 = self.current_way.target2 = self.current_way.target3 = self.current_way.target4 = world;
343                         }
344                         else if (self.impulse == 2)
345                         {
346                                 self.b_menu = 8;
347                                 self.b_menu_time = time;
348                                 self.last_way = self.current_way;
349                         }
350                         else if (self.impulse == 3)
351                         {
352                                 self.b_menu = 9;
353                                 self.b_menu_time = time;
354                                 self.last_way = self.current_way;
355                         }
356                         else if (self.impulse == 4)
357                         {
358                                 self.b_menu = 10;
359                                 self.b_menu_time = time;
360                                 self.last_way = self.current_way;
361                         }
362                         else if (self.impulse == 5)
363                         {
364                                 self.b_menu = 11;
365                                 self.b_menu_time = time;
366                                 self.last_way = self.current_way;
367                         }
368                         else if (self.impulse == 6)
369                         {
370                                 self.b_menu = 12;
371                                 self.b_menu_time = time;
372                                 self.last_way = self.current_way;
373                         }
374                         else if (self.impulse == 7)
375                                 make_waypoint(self.origin + self.view_ofs);
376                         else if (self.impulse == 8)
377                         {
378                                 self.b_menu = MENU_WAYPOINTS;
379                                 self.b_menu_time = time;
380                         }
381                         else if (self.impulse == 9)
382                         {
383                                 self.b_menu = MENU_FLAGS;
384                                 self.b_menu_time = time;
385                         }
386                         else if (self.impulse == 10)
387                         {
388                                 self.b_menu = MENU_MAIN;
389                                 self.b_menu_time = time;
390                         }
391                 }
392                 else if (self.b_menu == MENU_FLAGS)
393                 {
394
395                         if (self.current_way)
396                         {
397                                 if (self.impulse == 1)
398                                 {
399                                         if (self.current_way.b_aiflags & AI_DOORFLAG)
400                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOORFLAG);
401                                         else
402                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOORFLAG;
403         
404                                         self.b_menu_time = time;
405                                 }
406                                 else if (self.impulse == 2)
407                                 {
408                                         if (self.current_way.b_aiflags & AI_PRECISION)
409                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PRECISION);
410                                         else
411                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION;
412                                         self.b_menu_time = time;
413                                 }
414                                 else if (self.impulse == 3)
415                                 {
416                                         if (self.current_way.b_aiflags & AI_SURFACE)
417                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SURFACE);
418                                         else
419                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SURFACE;
420                                         self.b_menu_time = time;
421                                 }
422                                 else if (self.impulse == 4)
423                                 {
424                                         if (self.current_way.b_aiflags & AI_BLIND)
425                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_BLIND);
426                                         else
427                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND;
428                                         self.b_menu_time = time;
429                                 }
430                                 else if (self.impulse == 5)
431                                 {
432                                         if (self.current_way.b_aiflags & AI_JUMP)
433                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_JUMP);
434                                         else
435                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_JUMP;
436                                         self.b_menu_time = time;
437                                 }
438                                 else if (self.impulse == 6)
439                                 {
440                                         if (self.current_way.b_aiflags & AI_DIRECTIONAL)
441                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIRECTIONAL);
442                                         else
443                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIRECTIONAL;
444                                         self.b_menu_time = time;
445                                 }
446                                 else if (self.impulse == 7)
447                                 {
448                                         if (self.current_way.b_aiflags & AI_SUPER_JUMP)
449                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SUPER_JUMP);
450                                         else
451                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SUPER_JUMP;
452                                         self.b_menu_time = time;
453                                 }
454                         }
455                         if (self.impulse == 9)
456                         {
457                                 self.b_menu = MENU_FLAGS2;
458                                 self.b_menu_time = time;
459                         }
460                         else if (self.impulse == 10)
461                         {
462                                 self.b_menu = MENU_MAIN;
463                                 self.b_menu_time = time;
464                         }
465                 }
466                 else if (self.b_menu == MENU_FLAGS2)
467                 {
468
469                         if (self.current_way)
470                         {
471                                 if (self.impulse == 1)
472                                 {
473                                         if (self.current_way.b_aiflags & AI_DIFFICULT)
474                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIFFICULT);
475                                         else
476                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIFFICULT;                                                         self.b_menu_time = time;        
477                                 }
478                                 else if (self.impulse == 2)
479                                 {
480                                         if (self.current_way.b_aiflags & AI_PLAT_BOTTOM)
481                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PLAT_BOTTOM);
482                                         else
483                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PLAT_BOTTOM;
484                                         self.b_menu_time = time;
485                                 }
486                                 else if (self.impulse == 3)
487                                 {
488                                         if (self.current_way.b_aiflags & AI_RIDE_TRAIN)
489                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_RIDE_TRAIN);
490                                         else
491                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_RIDE_TRAIN;
492                                         self.b_menu_time = time;
493                                 }
494                                 else if (self.impulse == 4)
495                                 {
496                                         if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN)
497                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOOR_NO_OPEN);
498                                         else
499                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOOR_NO_OPEN;
500                                         self.b_menu_time = time;
501                                 }
502                                 else if (self.impulse == 5)
503                                 {
504                                         if (self.current_way.b_aiflags & AI_AMBUSH)
505                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_AMBUSH);
506                                         else
507                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_AMBUSH;
508                                         self.b_menu_time = time;
509                                 }
510                                 else if (self.impulse == 6)
511                                 {
512                                         if (self.current_way.b_aiflags & AI_SNIPER)
513                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SNIPER);
514                                         else
515                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SNIPER;
516                                         self.b_menu_time = time;
517                                 }
518                                 else if (self.impulse == 7)
519                                 {
520                                         if (self.current_way.b_aiflags & AI_TRACE_TEST)
521                                                 self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_TRACE_TEST);
522                                         else
523                                                 self.current_way.b_aiflags = self.current_way.b_aiflags | AI_TRACE_TEST;
524                                         self.b_menu_time = time;
525                                 }
526
527                         }
528                         if (self.impulse == 9)
529                         {
530                                 self.b_menu = MENU_FLAGS;
531                                 self.b_menu_time = time;
532                         }
533                         else if (self.impulse == 10)
534                         {
535                                 self.b_menu = MENU_MAIN;
536                                 self.b_menu_time = time;
537                         }
538                 }
539
540                 else if (self.b_menu == MENU_BOTS)
541                 {
542                         if (self.impulse == 1)
543                         {
544                                 self.impulse = 100;
545                                 return;
546                         }
547                         else if (self.impulse == 2)
548                         {
549                                 b_temp3 = self;
550                                 self = player_head;
551                                 while(self)
552                                 {
553                                         if (!self.ishuman)
554                                         {
555                                                 target_add(b_temp3);
556                                                 bot_get_path(b_temp3, TRUE);
557                                                 self = world;
558                                         }
559                                         else
560                                                 self = self._next;
561                                 }
562                                 self = b_temp3;
563                         }
564                         else if (self.impulse == 3)
565                         {
566                                 self.impulse = 102;
567                                 return;
568                         }
569                         else if (self.impulse == 4)
570                         {
571                                 b_temp1 = self;
572                                 self = player_head;
573                                 while(self)
574                                 {
575                                         if (!self.ishuman)
576                                         {
577                                                 self.target1 = self.target2 = self.target3 = self.target4 = world;
578                                                 route_table = world;
579                                         }
580                                         self = self._next;
581                                 }
582                                 self = b_temp1;
583                         }
584                         else if (self.impulse == 5)
585                         {
586                                 if (self.current_way)
587                                 {
588                                         b_temp1 = self;
589                                         self = player_head;
590                                         while(self)
591                                         {
592                                                 if (!self.ishuman)
593                                                 {
594                                                         setorigin(self, b_temp1.current_way.origin);
595                                                 }
596                                                 self = self._next;
597                                         }
598                                         self = b_temp1;
599                                 }
600                                 else
601                                         sprint(self, "select a waypoint first\n");
602                         }
603                         else if (self.impulse == 6)
604                         {
605                                 self.b_menu = 14;
606                                 self.b_menu_time = time;
607                         }
608                         else if (self.impulse == 10)
609                         {
610                                 self.b_menu = MENU_MAIN;
611                                 self.b_menu_time = time;
612                         }
613                 }
614                 else if (self.b_menu == MENU_WAYLIST)
615                 {
616                         if (self.impulse == 1)
617                         {
618                                 self.b_menu = 13;
619                                 self.b_menu_time = time;
620                         }
621                         else if (self.impulse == 2)
622                         {
623                                 if (dump_mode == 0)
624                                         DumpWaypoints();
625                                 else if (dump_mode == 1)
626                                         QCDumpWaypoints();
627                                 else if (dump_mode == 2)
628                                         BSPDumpWaypoints();
629                         }
630                         else if (self.impulse == 3)
631                         {
632                                 t = way_head;
633                                 while(t)
634                                 {
635                                         if ((t.target1 == world) && (t.target2 == world) && (t.target3 == world) && (t.target4 == world))
636                                         {
637                                                 sprint(self, "Waypoint #");
638                                                 h = ftos(t.count);
639                                                 sprint(self, h);
640                                                 sprint(self, " has no outbound links\n");
641                                         }
642                                         if ((t.target1 == t) || (t.target2 == t) || (t.target3 == t) || (t.target4 == t))
643                                         {
644                                                 sprint(self, "Waypoint #");
645                                                 h = ftos(t.count);
646                                                 sprint(self, h);
647                                                 sprint(self, " links to itself (??)\n");
648                                         }
649                                         t = t._next;
650                                 }
651                                 sprint(self, "Error check complete\n");
652                         }
653                         else if (self.impulse == 4)
654                         {
655                                 sprint(self, "not in this version (FBX 0.10.0)\n");
656                         }
657                         else if (self.impulse == 5)
658                         {
659                                 if (waypoint_mode == WM_EDITOR_DYNAMIC)
660                                         waypoint_mode = WM_EDITOR;
661                                 else
662                                         waypoint_mode = WM_EDITOR_DYNAMIC;
663                                 self.b_menu_time = time;
664
665                         }
666                         else if (self.impulse == 6)
667                         {
668                                 if (waypoint_mode == WM_EDITOR_DYNLINK)
669                                         waypoint_mode = WM_EDITOR;
670                                 else
671                                         waypoint_mode = WM_EDITOR_DYNLINK;
672                                 self.b_menu_time = time;
673                         }
674                         else if (self.impulse == 7)
675                         {
676                                 dump_mode = 0;
677                                 self.b_menu_time = time;
678                         }
679                         else if (self.impulse == 8)
680                         {
681                                 dump_mode = 1;
682                                 self.b_menu_time = time;
683                         }
684                         else if (self.impulse == 9)
685                         {
686                                 dump_mode = 2;
687                                 self.b_menu_time = time;
688                         }
689                         else if (self.impulse == 10)
690                         {
691                                 self.b_menu = MENU_MAIN;
692                                 self.b_menu_time = time;
693                         }
694                 }
695                 else if (self.b_menu == 8)
696                 {
697                         if (self.impulse == 1)
698                         {
699                                 if (self.current_way)
700                                 {
701                                         if (!LinkWays(self.last_way, self.current_way))
702                                                 sprint(self, "Unable to link them\n");
703                                         self.b_menu = MENU_LINKS;
704                                         self.b_menu_time = time;
705                                 }
706                         }
707                         else if (self.impulse == 2)
708                         {
709                                 self.b_menu = MENU_LINKS;
710                                 self.b_menu_time = time;
711                         }
712                 }
713                 else if (self.b_menu == 9)
714                 {
715                         if (self.impulse == 1)
716                         {
717                                 if (self.current_way)
718                                 {
719                                         if (!TeleLinkWays(self.last_way, self.current_way))
720                                                 sprint(self, "Unable to link them\n");
721                                         self.b_menu = MENU_LINKS;
722                                         self.b_menu_time = time;
723                                 }
724                         }
725                         else if (self.impulse == 2)
726                         {
727                                 self.b_menu = MENU_LINKS;
728                                 self.b_menu_time = time;
729                         }
730                 }
731                 else if (self.b_menu == 10)
732                 {
733                         if (self.impulse == 1)
734                         {
735                                 if (self.current_way)
736                                 {
737                                         UnlinkWays(self.last_way, self.current_way);
738                                         self.b_menu = MENU_LINKS;
739                                         self.b_menu_time = time;
740                                 }
741                         }
742                         else if (self.impulse == 2)
743                         {
744                                 self.b_menu = MENU_LINKS;
745                                 self.b_menu_time = time;
746                         }
747                 }
748                 else if (self.b_menu == 11)
749                 {
750                         if (self.impulse == 1)
751                         {
752                                 if (self.current_way)
753                                 {
754                                         if (!LinkWays(self.last_way, self.current_way))
755                                                 sprint(self, "Unable to link 1 to 2\n");
756                                         if (!LinkWays(self.current_way, self.last_way))
757                                                 sprint(self, "Unable to link 2 to 1\n");
758                                         self.b_menu = MENU_LINKS;
759                                         self.b_menu_time = time;
760                                 }
761                         }
762                         else if (self.impulse == 2)
763                         {
764                                 self.b_menu = MENU_LINKS;
765                                 self.b_menu_time = time;
766                         }
767                 }
768                 else if (self.b_menu == 12)
769                 {
770                         if (self.impulse == 1)
771                         {
772                                 if (self.current_way)
773                                 {
774                                         UnlinkWays(self.last_way, self.current_way);
775                                         UnlinkWays(self.current_way, self.last_way);
776                                         self.b_menu = MENU_LINKS;
777                                         self.b_menu_time = time;
778                                 }
779                         }
780                         else if (self.impulse == 2)
781                         {
782                                 self.b_menu = MENU_LINKS;
783                                 self.b_menu_time = time;
784                         }
785                 }
786                 else if (self.b_menu == 13)
787                 {
788                         if (self.impulse == 1)
789                         {
790                                 ClearAllWays();
791                                 self.b_menu = MENU_WAYLIST;
792                                 self.b_menu_time = time;
793                         }
794                         else if (self.impulse == 2)
795                         {
796                                 self.b_menu = MENU_WAYLIST;
797                                 self.b_menu_time = time;
798                         }
799                 }
800                 else if (self.b_menu == 14)
801                 {
802                         if (self.impulse == 10)
803                                 self.impulse = 0;
804                         self.b_menu_value = self.b_menu_value * 10 + self.impulse;
805                         self.b_menu_time = 0;
806                 }
807                 else if (self.b_menu == 15)
808                 {
809                         if (self.impulse == 1)
810                         {
811                                 delete_waypoint(self.last_way);
812                                 self.b_menu = MENU_WAYPOINTS;
813                                 self.b_menu_time = time;
814                         }
815                         else if (self.impulse == 2)
816                         {
817                                 self.b_menu = MENU_WAYPOINTS;
818                                 self.b_menu_time = time;
819                         }
820                 }
821                 self.impulse = 0;
822                 
823         }
824         if (self.b_menu_time < time)
825         {
826                 if (self.b_menu == MENU_MAIN)
827                 {
828                         s1 = "-- Main Menu --\n[1] >>Waypoint Management\n[2] >>Link Management    \n[3] >>AI Flag Management \n[4] >>Bot Management     \n[5] >>Waylist Management \n";
829                         if (self.movetype == MOVETYPE_NOCLIP)
830                                 s2 = "[6] [#] Noclip           \n";
831                         else
832                                 s2 = "[6] [ ] Noclip           \n";
833                         
834                         if (self.flags & FL_GODMODE)
835                                 s3 = "[7] [#] Godmode          \n";
836                         else
837                                 s3 = "[7] [ ] Godmode          \n";
838                         if (self.b_aiflags & AI_HOLD_SELECT)
839                                 s4 = "[8] [#] Hold Select      \n";
840                         else
841                                 s4 = "[8] [ ] Hold Select      \n";
842                         s5 = "[9] Teleport to Way #    \n[0] Close Menu           \n";
843                 }
844                 else if (self.b_menu == MENU_WAYPOINTS)
845                 {
846                         s1 = "-- Waypoint Management --\n[1] Move Waypoint        \n[2] Delete Waypoint      \n[3] Make Waypoint        \n[4] Make Way + Link      \n[5] Make Way + Link X2   \n[6] Make Way + Telelink  \n[7] Show waypoint info   \n[8] >>Link Management    \n[9] >>AI Flag Management \n[0] >>Main Menu          \n";
847                 }
848                 else if (self.b_menu == MENU_LINKS)
849                 {
850                         s1 = "-- Link Management --\n[1] Unlink Waypoint      \n[2] Create Link          \n[3] Create Telelink      \n[4] Delete Link          \n[5] Create Link X2       \n[6] Delete Link X2       \n[7] >Make Waypoint       \n[8] >>Waypoint Management\n[9] >>AI Flag Management \n[0] >>Main Menu          \n";
851                 }
852                 else if (self.b_menu == MENU_FLAGS)
853                 {
854                         if (self.current_way.b_aiflags & AI_DOORFLAG)
855                                 s1 = "-- AI Flag Management --\n[1] [#] Door Flag        \n";
856                         else
857                                 s1 = "-- AI Flag Management --\n[1] [ ] Door Flag        \n";
858
859                         if (self.current_way.b_aiflags & AI_PRECISION)
860                                 s2 = "[2] [#] Precision        \n";
861                         else
862                                 s2 = "[2] [ ] Precision        \n";
863
864                         if (self.current_way.b_aiflags & AI_SURFACE)
865                                 s3 = "[3] [#] Surface for air  \n";
866                         else
867                                 s3 = "[3] [ ] Surface for air  \n";
868
869                         if (self.current_way.b_aiflags & AI_BLIND)
870                                 s4 = "[4] [#] Blind mode       \n";
871                         else
872                                 s4 = "[4] [ ] Blind mode       \n";
873
874                         if (self.current_way.b_aiflags & AI_JUMP)
875                                 s5 = "[5] [#] Jump             \n";
876                         else
877                                 s5 = "[5] [ ] Jump             \n";
878
879                         if (self.current_way.b_aiflags & AI_DIRECTIONAL)
880                                 s6 = "[6] [#] Directional      \n";
881                         else
882                                 s6 = "[6] [ ] Directional      \n";
883
884                         if (self.current_way.b_aiflags & AI_SUPER_JUMP)
885                                 s7 = "[7] [#] Super Jump       \n\n[9] >>AI Flags page 2    \n[0] >>Main Menu          \n";
886                         else
887                                 s7 = "[7] [ ] Super Jump       \n\n[9] >>AI Flags page 2    \n[0] >>Main Menu          \n";
888                 }
889                 else if (self.b_menu == MENU_FLAGS2)
890                 {
891                         if (self.current_way.b_aiflags & AI_DIFFICULT)
892                                 s1 = "-- AI Flags pg. 2--\n[1] [#] Difficult        \n";
893                         else
894                                 s1 = "-- AI Flags pg. 2--\n[1] [ ] Difficult        \n";
895
896                         if (self.current_way.b_aiflags & AI_PLAT_BOTTOM)
897                                 s2 = "[2] [#] Wait for plat    \n";
898                         else
899                                 s2 = "[2] [ ] Wait for plat    \n";
900
901                         if (self.current_way.b_aiflags & AI_RIDE_TRAIN)
902                                 s3 = "[3] [#] Ride train       \n";
903                         else
904                                 s3 = "[3] [ ] Ride train       \n";
905
906                         if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN)
907                                 s4 = "[4] [#] Door flag no open\n";
908                         else
909                                 s4 = "[4] [ ] Door flag no open\n";
910
911                         if (self.current_way.b_aiflags & AI_AMBUSH)
912                                 s5 = "[5] [#] Ambush           \n";
913                         else
914                                 s5 = "[5] [ ] Ambush           \n";
915
916                         if (self.current_way.b_aiflags & AI_SNIPER)
917                                 s6 = "[6] [#] Snipe            \n";
918                         else
919                                 s6 = "[6] [ ] Snipe            \n";
920
921                         if (self.current_way.b_aiflags & AI_TRACE_TEST)
922                                 s7 = "[7] [#] Trace Test       \n\n[9] >>AI Flag Management \n[0] >>Main Menu          \n";
923                         else
924                                 s7 = "[7] [ ] Trace Test       \n\n[9] >>AI Flag Management \n[0] >>Main Menu          \n";
925
926                 }
927                 else if (self.b_menu == MENU_BOTS)
928                 {
929                         s1 = "-- Bot Management --\n[1] Add a Test Bot       \n[2] Order Test Bot here  \n[3] Remove Test Bot      \n[4] Stop Test Bot        \n[5] Teleport Bot here    \n[6] Teleport to Way #    \n\n\n\n[0] >>Main Menu          \n";
930                 }
931                 else if (self.b_menu == MENU_WAYLIST)
932                 {
933                         s1 = "-- Waylist Management --\n[1] Delete ALL Waypoints \n[2] Dump Waypoints       \n[3] Check For Errors     \n[4] Save Waypoints       \n";
934                         
935                         if (waypoint_mode == WM_EDITOR_DYNAMIC)
936                                 s2 = "[5] [#] Dynamic Mode     \n[6] [#] Dynamic Link     \n";
937                         else if (waypoint_mode == WM_EDITOR_DYNLINK)
938                                 s2 = "[5] [ ] Dynamic Mode     \n[6] [#] Dynamic Link     \n";
939                         else
940                                 s2 = "[5] [ ] Dynamic Mode     \n[6] [ ] Dynamic Link     \n";
941                         if (dump_mode == 0)
942                                 s3 = "[7] [#] WAY output       \n[8] [ ] QC output        \n[9] [ ] BSP ents output  \n[0] Main Menu            \n";
943                         else if (dump_mode == 1)
944                                 s3 = "[7] [ ] WAY output       \n[8] [#] QC output        \n[9] [ ] BSP ents output  \n[0] Main Menu            \n";
945                         else if (dump_mode == 2)
946                                 s3 = "[7] [ ] WAY output       \n[8] [ ] QC output        \n[9] [#] BSP ents output  \n[0] Main Menu            \n";
947
948                 }
949                 else if (self.b_menu == 8)
950                         s1 = "-- Link Ways --\n\nSelect another way and push 1\nor press 2 to cancel";
951                 else if (self.b_menu == 9)
952                         s1 = "-- Telelink Ways --\n\nSelect another way and push 1\nor press 2 to cancel";
953                 else if (self.b_menu == 10)
954                         s1 = "-- Delete Link --\n\nSelect another way and push 1\nor press 2 to cancel";
955                 else if (self.b_menu == 11)
956                         s1 = "-- Create Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel";
957                 else if (self.b_menu == 12)
958                         s1 = "-- Delete Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel";
959                 else if (self.b_menu == 13)
960                         s1 = "-- Delete ALL Ways --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel";
961                 else if (self.b_menu == 14)
962                 {
963                         s1 = "-- Teleport to Way # --\n\nEnter way number and press\nimpulse 104 to warp\n\nWaypoint #";
964                         s2 = ftos(self.b_menu_value);
965
966                 }
967                 else if (self.b_menu == 15)
968                         s1 = "-- Delete Waypoint --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel";
969                 frik_big_centerprint(self, s1, s2, s3, s4, s5, s6, s7);
970                 self.b_menu_time = time + 1.25;
971         }
972 };
973
974
975 // engage menu
976 void() bot_way_edit =
977 {
978         local entity t;
979         local float f;
980         if (self.b_menu_value)
981         {
982                 if (self.b_menu == 14)
983                 {
984                         t = WaypointForNum(self.b_menu_value);
985                         if (t)
986                                 setorigin(self, t.origin - self.view_ofs);
987                         else
988                                 sprint(self, "No waypoint with that number\n");
989
990                         self.b_menu = MENU_MAIN;
991                         self.b_menu_time = time;
992                 }
993                 self.b_menu_value = 0;
994                 return;
995         }
996         if (waypoint_mode < WM_EDITOR)
997         {
998                 self.b_menu = MENU_MAIN;
999                 waypoint_mode = WM_EDITOR;
1000                 self.b_menu_time = 0;
1001                 cvar_set("saved2", "0");
1002                 WriteByte(MSG_ALL, 8);
1003                 WriteByte(MSG_ALL, 1);
1004                 WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n");
1005                 localcmd("cmdline\n");
1006                 t = way_head;
1007                 while (t)
1008                 {
1009                         //setmodel(t, "progs/s_bubble.spr"); // show the waypoints
1010                         t = t._next;
1011                 }
1012                 //if (self.current_way)
1013                 //      setmodel(self.current_way, "progs/s_light.spr");
1014         }
1015         else
1016         {
1017                 saved2 = cvar("saved2");
1018                 if (saved2 != 0)
1019                 {
1020                         f = self.b_menu;
1021                         self.b_menu = floor(saved2/16);
1022                         self.impulse = saved2 & 15;
1023                         bot_menu_display();
1024                         self.b_menu = f;
1025                         cvar_set("saved2", "0");
1026                         return;
1027                 }
1028                 self.b_menu = 0;
1029                 waypoint_mode = WM_LOADED;
1030                 t = way_head;
1031                 while (t)
1032                 {
1033                         setmodel(t, string_null); // hide the waypoints
1034                         t = t._next;
1035                 }
1036         }
1037 };
1038
1039
1040 /*
1041 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1042
1043 Waypoint Saving to file. 
1044
1045 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1046 */
1047
1048
1049 // bytecount is really iffy
1050 // since there is no true way to determine the length of an ftos
1051 // it uses an approximate of 5
1052 // various other things are guesses, but I don't cut it at the absolute
1053 // max so it should be okay
1054
1055 void() PrintWaypoint =
1056 {
1057         local entity t;
1058         local float needcolon;
1059         local string h;
1060         
1061         if (self.enemy == world)
1062                 t = way_head;
1063         else
1064                 t = self.enemy._next;
1065         if (bytecounter >= 8000)
1066         {
1067                 bprint("exec maps/");
1068                 bprint(mapname);
1069                 bprint(".wa");
1070                 h = ftos(filecount);
1071                 bprint(h);
1072                 filecount = filecount + 1;
1073                 bprint("\n// **** break here **** \n");
1074                 bytecounter = 26;
1075         }
1076         if (t == world)
1077         {
1078                 remove(self);
1079                 fixer = world;
1080                 bprint("saved4 3\n// end waypoint dump\n");
1081                 bytecounter = bytecounter + 27;
1082                 return;
1083         }
1084         if ((t.origin_x != saved1) || (t.count == 1))
1085         {
1086                 bprint("saved1 ");
1087                 h = ftos(t.origin_x);
1088                 bprint(h);
1089                 saved1 = t.origin_x;
1090                 bytecounter = bytecounter + 12;
1091                 needcolon = TRUE;
1092         }
1093         if ((t.origin_y != saved2) || (t.count == 1))
1094         {
1095                 if (needcolon)
1096                 {
1097                         bprint("; ");
1098                         bytecounter = bytecounter + 2;
1099                 }
1100                 else
1101                         needcolon = TRUE;
1102                 bprint("saved2 ");
1103                 h = ftos(t.origin_y);
1104                 bprint(h);
1105                 bytecounter = bytecounter + 12;
1106                 saved2 = t.origin_y;
1107         }
1108         if ((t.origin_z != saved3) || (t.count == 1))
1109         {
1110                 if (needcolon)
1111                 {
1112                         bprint("; ");
1113                         bytecounter = bytecounter + 2;
1114                 }
1115                 else
1116                         needcolon = TRUE;
1117                 bprint("saved3 ");
1118                 h = ftos(t.origin_z);
1119                 bprint(h);
1120                 bytecounter = bytecounter + 12;
1121                 saved3 = t.origin_z;
1122         }
1123         bytecounter = bytecounter + 1;
1124         bprint("\n");
1125         needcolon = FALSE;
1126         if ((scratch1 != t.target1.count) || t.count == 1)
1127         {
1128                 needcolon = TRUE;
1129                 bprint("scratch1 ");
1130                 bytecounter = bytecounter + 14;
1131                 h = ftos(t.target1.count);
1132                 bprint(h);
1133                 scratch1 = t.target1.count;
1134         }
1135         if ((scratch2 != t.target2.count) || t.count == 1)
1136         {
1137                 if (needcolon)
1138                 {
1139                         bprint("; ");
1140                         bytecounter = bytecounter + 2;
1141                 }
1142                 else
1143                         needcolon = TRUE;
1144                 bprint("scratch2 ");
1145                 bytecounter = bytecounter + 14;
1146                 h = ftos(t.target2.count);
1147                 bprint(h);
1148                 scratch2 = t.target2.count;
1149         }
1150         if ((scratch3 != t.target3.count) || t.count == 1)
1151         {
1152                 if (needcolon)
1153                 {
1154                         bprint("; ");
1155                         bytecounter = bytecounter + 2;
1156                 }
1157                 else
1158                         needcolon = TRUE;
1159                 bprint("scratch3 ");
1160                 bytecounter = bytecounter + 14;
1161                 h = ftos(t.target3.count);
1162                 bprint(h);
1163                 scratch3 = t.target3.count;
1164         }
1165         if ((scratch4 != t.target4.count) || t.count == 1)
1166         {
1167                 if (needcolon)
1168                 {
1169                         bprint("; ");
1170                         bytecounter = bytecounter + 2;
1171                 }
1172                 else
1173                         needcolon = TRUE;
1174                 bprint("scratch4 ");
1175                 bytecounter = bytecounter + 14;
1176                 h = ftos(t.target4.count);
1177                 bprint(h);
1178                 scratch4 = t.target4.count;
1179         }
1180         bprint("\nsaved4 ");
1181         bytecounter = bytecounter + 19;
1182         if (t.count != 1)
1183                 h = ftos(t.b_aiflags * 4 + 2);
1184         else 
1185                 h = ftos(t.b_aiflags * 4 + 1);
1186         bprint(h);
1187         bprint ("; wait\n");
1188         self.nextthink = time + 0.01;
1189         self.enemy = t;
1190 };
1191
1192 // to allow for 100+ waypoints, we need to trick the runaway loop counter
1193 void() DumpWaypoints =
1194 {
1195         bytecounter = 50; 
1196         filecount = 1;
1197
1198         bprint("// ");
1199         bprint(world.message);
1200         bprint("- maps/");
1201         bprint(mapname);
1202         bprint(".way\n");
1203         bprint("// Ways by ");
1204         bprint(self.netname);
1205         bprint("\n");
1206         if (!fixer)
1207         {
1208                 fixer = spawn();
1209                 fixer.nextthink = time + 0.01;
1210                 fixer.think = PrintWaypoint;
1211                 fixer.enemy = world;
1212         }
1213 };
1214
1215 void() PrintQCWaypoint =
1216 {
1217         local entity t;
1218         local string h;
1219         
1220         if (self.enemy == world)
1221                 t = way_head;
1222         else
1223                 t = self.enemy._next;
1224
1225         if (t == world)
1226         {
1227                 remove(self);
1228                 fixer = world;
1229                 bprint("};\n\n// End dump\n");
1230                 return;
1231         }
1232         bprint("        make_way(");
1233         h = vtos(t.origin);
1234         bprint(h);
1235         bprint(", '");
1236         h = ftos(t.target1.count);
1237         bprint(h);
1238         bprint(" ");
1239         h = ftos(t.target2.count);
1240         bprint(h);
1241         bprint(" ");
1242         h = ftos(t.target3.count);
1243         bprint(h);
1244         bprint("', ");
1245         h = ftos(t.target4.count);
1246         bprint(h);
1247         bprint(", ");
1248         h = ftos(t.b_aiflags);
1249         bprint(h);
1250         bprint(");\n");
1251         self.nextthink = time + 0.01;
1252         self.enemy = t;
1253
1254 };
1255 void() QCDumpWaypoints =
1256 {
1257         bprint("/* QC Waypoint Dump - src/frikbot/map_");
1258
1259         bprint(mapname);
1260         bprint(".qc\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, float flargs) make_way;\n");
1261         bprint("// Ways by ");
1262         bprint(self.netname);
1263         bprint("\n\n");
1264
1265         bprint("void() map_");
1266         bprint(mapname);
1267         bprint(" =\n{\n");
1268
1269
1270         if (!fixer)
1271         {
1272                 fixer = spawn();
1273                 fixer.nextthink = time + 0.01;
1274                 fixer.think = PrintQCWaypoint;
1275                 fixer.enemy = world;
1276         }
1277 };
1278
1279 void() PrintBSPWaypoint =
1280 {
1281         local entity t;
1282         local string h;
1283
1284         if (self.enemy == world)
1285                 t = way_head;
1286         else
1287                 t = self.enemy._next;
1288
1289         if (t == world)
1290         {
1291                 bprint("\n\n// End dump\n");
1292                 remove(self);
1293                 fixer = world;
1294                 return;
1295         }
1296         bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \"");
1297         h = ftos(t.origin_x);
1298         bprint(h);
1299         bprint(" ");
1300         h = ftos(t.origin_y);
1301         bprint(h);
1302         bprint(" ");
1303         h = ftos(t.origin_z);
1304         bprint(h);
1305         if (t.target1.count)
1306         {
1307                 bprint("\"\n\"b_pants\" \"");
1308                 h = ftos(t.target1.count);
1309                 bprint(h);
1310         }
1311         if (t.target2.count)
1312         {
1313                 bprint("\"\n\"b_skill\" \"");
1314                 h = ftos(t.target2.count);
1315                 bprint(h);
1316         }
1317         if (t.target3.count)
1318         {
1319                 bprint("\"\n\"b_shirt\" \"");
1320                 h = ftos(t.target3.count);
1321                 bprint(h);
1322         }
1323         if (t.target4.count)
1324         {
1325                 bprint("\"\n\"b_frags\" \"");
1326                 h = ftos(t.target4.count);
1327                 bprint(h);
1328         }
1329         if (t.b_aiflags)
1330         {
1331                 bprint("\"\n\"b_aiflags\" \"");
1332                 h = ftos(t.b_aiflags);
1333                 bprint(h);
1334         }
1335         bprint("\"\n}\n");
1336         self.nextthink = time + 0.01;
1337         self.enemy = t;
1338
1339 };
1340 void() BSPDumpWaypoints =
1341 {
1342         bprint("/* BSP entities Dump - maps/");
1343
1344         bprint(mapname);
1345         bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n\n");
1346
1347         if (!fixer)
1348         {
1349                 fixer = spawn();
1350                 fixer.nextthink = time + 0.01;
1351                 fixer.think = PrintBSPWaypoint;
1352                 fixer.enemy = world;
1353         }
1354 };