more impulse 107 goodness: verifying WPs near spawns
[divverent/nexuiz.git] / data / qcsrc / server / cl_impulse.qc
1 void CopyBody(float keepvelocity);
2
3 // changes by LordHavoc on 03/30/04
4 // cleaned up dummy code
5 // dummies are now removed eventually after being gibbed (norespawn = TRUE)
6 // dummy impulse now checks sv_cheats to prevent players from overwhelming server with dummies
7 // dummies now use player code where possible
8
9 void player_anim (void);
10 void DummyThink(void)
11 {
12         self.think = DummyThink;
13         self.nextthink = time;
14         SV_PlayerPhysics();
15         PlayerPreThink();
16         //player_anim();
17         PlayerPostThink();
18 }
19
20 // from dpmod
21 void printsurfaceinfo(entity e, vector v)
22 {
23         local float surfnum, numpoints, vnum;
24         local string s;
25         local vector n;
26         surfnum = getsurfacenearpoint(e, v);
27         if (surfnum >= 0)
28         {
29                 sprint(self, "texture: ");
30                 s = getsurfacetexture(e, surfnum);
31                 sprint(self, s);
32                 sprint(self, " normal: ");
33                 n = getsurfacenormal(e, surfnum);
34                 sprint(self, vtos(n));
35                 sprint(self, " ");
36                 numpoints = getsurfacenumpoints(e, surfnum);
37                 sprint(self, ftos(numpoints));
38                 sprint(self, " verts:");
39                 vnum = 0;
40                 while (vnum < numpoints)
41                 {
42                         sprint(self, " ");
43                         n = getsurfacepoint(e, surfnum, vnum);
44                         sprint(self, vtos(n));
45                         vnum = vnum + 1;
46                 }
47                 sprint(self, " point tested: ");
48                 sprint(self, vtos(v));
49                 sprint(self, " nearest point on surface: ");
50                 n = getsurfaceclippedpoint(e, surfnum, v);
51                 sprint(self, vtos(n));
52                 sprint(self, "\n");
53         }
54 };
55
56 /*
57  * Impulse map:
58  *
59  * 0 reserved (no input)
60  * 1 to 9, 14: weapon shortcuts
61  * 10: next weapon according to linear list
62  * 11: most recently used weapon
63  * 12: previous weapon according to linear list
64  * 13: best weapon according to priority list
65  * 15: next weapon according to priority list
66  * 16: previous weapon according to priority list
67  * 17: throw weapon
68  * 18: next weapon according to sbar_hudselector 1 list
69  * 19: previous weapon according to sbar_hudselector 1 list
70  * 20: reload if needed
71  *
72  * 30 to 39: create waypoints
73  * 47: clear personal waypoints
74  * 48: clear team waypoints
75  *
76  * 99: loaded
77  *
78  * 140: moving clone
79  * 141: ctf speedrun
80  * 142: fixed clone
81  * 143: emergency teleport
82  * 144: printsurfaceinfo
83  * 145: distance
84  * 148: unfairly eliminate
85  *
86  * TODO:
87  * 200 to 209: prev weapon shortcuts
88  * 210 to 219: best weapon shortcuts
89  * 220 to 229: next weapon shortcuts
90  * 230 to 253: individual weapons (up to 24)
91  */
92
93 void ImpulseCommands (void)
94 {
95         local float imp;
96         vector org;
97         float i;
98         float m;
99         float wep;
100         entity e, e2;
101
102         imp = self.impulse;
103         if (!imp || gameover)
104                 return;
105         self.impulse = 0;
106
107         if (timeoutStatus == 2) //don't allow any impulses while the game is paused
108                 return;
109
110         if (imp >= 1 && imp <= 9)
111         {
112                 // weapon switching impulses
113                 if(self.deadflag == DEAD_NO)
114                         W_NextWeaponOnImpulse(imp);
115                 else
116                         self.impulse = imp; // retry in next frame
117         }
118         else if(imp >= 10 && imp <= 20)
119         {
120                 if(self.deadflag == DEAD_NO)
121                 {
122                         switch(imp)
123                         {
124                                 case 10:
125                                         W_NextWeapon (0);
126                                         break;
127                                 case 11:
128                                         W_SwitchWeapon (self.cnt); // previously used
129                                         break;
130                                 case 12:
131                                         W_PreviousWeapon (0);
132                                         break;
133                                 case 13:
134                                         W_SwitchWeapon (w_getbestweapon(self));
135                                         break;
136                                 case 14:
137                                         W_NextWeaponOnImpulse(0);
138                                         break;
139                                 case 15:
140                                         W_NextWeapon (2);
141                                         break;
142                                 case 16:
143                                         W_PreviousWeapon (2);
144                                         break;
145                                 case 17:
146                                         if (!g_minstagib)
147                                                 W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750), '0 0 0', TRUE);
148                                         break;
149                                 case 18:
150                                         W_NextWeapon (1);
151                                         break;
152                                 case 19:
153                                         W_PreviousWeapon (1);
154                                         break;
155                                 case 20:
156                                         W_Reload ();
157                                         break;
158                         }
159                 }
160                 else
161                         self.impulse = imp; // retry in next frame
162         }
163         else if(imp >= 200 && imp <= 229)
164         {
165                 if(self.deadflag == DEAD_NO)
166                 {
167                         // custom order weapon cycling
168                         i = mod(imp, 10);
169                         m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
170                         W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
171                 }
172                 else
173                         self.impulse = imp; // retry in next frame
174         }
175         else if(imp >= 230 && imp <= 253)
176         {
177                 if(self.deadflag == DEAD_NO)
178                         W_SwitchWeapon (imp - 230 + WEP_FIRST);
179                 else
180                         self.impulse = imp; // retry in next frame
181         }
182         // deploy waypoints
183         else if (imp >= 30 && imp <= 49)
184         {
185                 entity wp;
186                 switch(imp)
187                 {
188                         case 30:
189                                 wp = WaypointSprite_DeployPersonal("waypoint", self.origin);
190                                 if(wp)
191                                 {
192                                         WaypointSprite_UpdateTeamRadar(wp, RADARICON_WAYPOINT, '0 1 1');
193                                         WaypointSprite_Ping(wp);
194                                 }
195                                 if(sv_cheats)
196                                 {
197                                         if(!self.personal)
198                                         {
199                                                 self.personal = spawn();
200                                                 self.personal.classname = "personal_wp";
201                                         }
202                                         self.personal.origin = self.origin;
203                                         self.personal.v_angle = self.v_angle;
204                                         self.personal.velocity = self.velocity;
205                                         self.personal.ammo_rockets = self.ammo_rockets;
206                                         self.personal.ammo_nails = self.ammo_nails;
207                                         self.personal.ammo_cells = self.ammo_cells;
208                                         self.personal.ammo_shells = self.ammo_shells;
209                                         self.personal.ammo_fuel = self.ammo_fuel;
210                                         self.personal.health = self.health;
211                                         self.personal.armorvalue = self.armorvalue;
212                                         self.personal.weapons = self.weapons;
213                                         self.personal.items = self.items;
214                                         self.personal.pauserotarmor_finished = self.pauserotarmor_finished;
215                                         self.personal.pauserothealth_finished = self.pauserothealth_finished;
216                                         self.personal.pauserotfuel_finished = self.pauserotfuel_finished;
217                                         self.personal.pauseregen_finished = self.pauseregen_finished;
218                                         self.personal.strength_finished = self.strength_finished;
219                                         self.personal.invincible_finished = self.invincible_finished;
220                                         self.personal.teleport_time = time;
221                                 }
222                                 sprint(self, "personal waypoint spawned at location\n");
223                                 break;
224                         case 31:
225                                 wp = WaypointSprite_DeployPersonal("waypoint", self.cursor_trace_endpos);
226                                 if(wp)
227                                 {
228                                         WaypointSprite_UpdateTeamRadar(wp, RADARICON_WAYPOINT, '0 1 1');
229                                         WaypointSprite_Ping(wp);
230                                 }
231                                 sprint(self, "personal waypoint spawned at crosshair\n");
232                                 break;
233                         case 32:
234                                 if(vlen(self.death_origin))
235                                 {
236                                         wp = WaypointSprite_DeployPersonal("waypoint", self.death_origin);
237                                         if(wp)
238                                         {
239                                                 WaypointSprite_UpdateTeamRadar(wp, RADARICON_WAYPOINT, '0 1 1');
240                                                 WaypointSprite_Ping(wp);
241                                         }
242                                         sprint(self, "personal waypoint spawned at death location\n");
243                                 }
244                                 break;
245                         case 33:
246                                 if(self.deadflag == DEAD_NO && teams_matter)
247                                 {
248                                         wp = WaypointSprite_Attach("helpme", TRUE);
249                                         if(wp)
250                                                 WaypointSprite_UpdateTeamRadar(wp, RADARICON_HELPME, '1 0.5 0'); // TODO choose better color
251                                         if(!wp)
252                                                 wp = self.waypointsprite_attachedforcarrier; // flag sprite?
253                                         if(wp)
254                                                 WaypointSprite_Ping(wp);
255                                         sprint(self, "HELP ME attached\n");
256                                 }
257                                 break;
258                         case 34:
259                                 wp = WaypointSprite_DeployFixed("here", FALSE, self.origin);
260                                 if(wp)
261                                 {
262                                         WaypointSprite_UpdateTeamRadar(wp, RADARICON_HERE, '0 1 0');
263                                         WaypointSprite_Ping(wp);
264                                 }
265                                 sprint(self, "HERE spawned at location\n");
266                                 break;
267                         case 35:
268                                 wp = WaypointSprite_DeployFixed("here", FALSE, self.cursor_trace_endpos);
269                                 if(wp)
270                                 {
271                                         WaypointSprite_UpdateTeamRadar(wp, RADARICON_HERE, '0 1 0');
272                                         WaypointSprite_Ping(wp);
273                                 }
274                                 sprint(self, "HERE spawned at crosshair\n");
275                                 break;
276                         case 36:
277                                 if(vlen(self.death_origin))
278                                 {
279                                         wp = WaypointSprite_DeployFixed("here", FALSE, self.death_origin);
280                                         if(wp)
281                                         {
282                                                 WaypointSprite_UpdateTeamRadar(wp, RADARICON_HERE, '0 1 0');
283                                                 WaypointSprite_Ping(wp);
284                                         }
285                                         sprint(self, "HERE spawned at death location\n");
286                                 }
287                                 break;
288                         case 37:
289                                 wp = WaypointSprite_DeployFixed("danger", FALSE, self.origin);
290                                 if(wp)
291                                 {
292                                         WaypointSprite_UpdateTeamRadar(wp, RADARICON_DANGER, '1 0.5 0');
293                                         WaypointSprite_Ping(wp);
294                                 }
295                                 sprint(self, "DANGER spawned at location\n");
296                                 break;
297                         case 38:
298                                 wp = WaypointSprite_DeployFixed("danger", FALSE, self.cursor_trace_endpos);
299                                 if(wp)
300                                 {
301                                         WaypointSprite_UpdateTeamRadar(wp, RADARICON_DANGER, '1 0.5 0');
302                                         WaypointSprite_Ping(wp);
303                                 }
304                                 sprint(self, "DANGER spawned at crosshair\n");
305                                 break;
306                         case 39:
307                                 if(vlen(self.death_origin))
308                                 {
309                                         wp = WaypointSprite_DeployFixed("danger", FALSE, self.death_origin);
310                                         if(wp)
311                                         {
312                                                 WaypointSprite_UpdateTeamRadar(wp, RADARICON_DANGER, '1 0.5 0');
313                                                 WaypointSprite_Ping(wp);
314                                         }
315                                         sprint(self, "DANGER spawned at death location\n");
316                                 }
317                                 break;
318                         case 47:
319                                 WaypointSprite_ClearPersonal();
320                                 if(self.personal)
321                                 {
322                                         remove(self.personal);
323                                         self.personal = world;
324                                 }
325                                 sprint(self, "personal waypoint cleared\n");
326                                 break;
327                         case 48:
328                                 WaypointSprite_ClearOwned();
329                                 if(self.personal)
330                                 {
331                                         remove(self.personal);
332                                         self.personal = world;
333                                 }
334                                 sprint(self, "all waypoints cleared\n");
335                                 break;
336                 }
337         }
338         else if(imp >= 140 && imp <= 149 || imp == 99) // 10 cheats ought to be enough for anyone
339         {
340                 if(self.deadflag == DEAD_NO)
341                 {
342                         if(sv_cheats || self.maycheat || (self.lip < sv_clones))
343                         {
344                                 switch(imp)
345                                 {
346                                          case 140:
347                                                 makevectors (self.v_angle);
348                                                 self.velocity = self.velocity + v_forward * 300;
349                                                 CopyBody(1);
350                                                 self.lip += 1;
351                                                 self.velocity = self.velocity - v_forward * 300;
352                                                 break;
353                                         case 142:
354                                                 CopyBody(0);
355                                                 self.lip += 1;
356                                                 break;
357                                  }
358                         }
359
360                         if(sv_cheats || self.maycheat)
361                         {
362                                 switch(imp)
363                                 {
364                                         case 99:
365                                                 self.weapons |= WEPBIT_ALL;
366                                                 self.items |= IT_UNLIMITED_AMMO;
367                                                 self.ammo_shells = g_pickup_shells_max;
368                                                 self.ammo_nails = g_pickup_nails_max;
369                                                 self.ammo_rockets = g_pickup_rockets_max;
370                                                 self.ammo_cells = g_pickup_cells_max;
371                                                 self.ammo_fuel = g_pickup_fuel_max;
372                                                 self.health = g_pickup_healthsmall_max;
373                                                 self.armorvalue = g_pickup_armorsmall_max;
374                                                 self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
375                                                 self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
376                                                 self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
377                                                 self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
378                                                 // precache weapon models/sounds
379                                                 wep = WEP_FIRST;
380                                                 while (wep <= WEP_LAST)
381                                                 {
382                                                         weapon_action(wep, WR_PRECACHE);
383                                                         wep = wep + 1;
384                                                 }
385                                                 break;
386                                         case 141:
387                                                 if(self.personal)
388                                                 {
389                                                         self.speedrunning = TRUE;
390                                                         tracebox(self.personal.origin, self.mins, self.maxs, self.personal.origin, MOVE_WORLDONLY, self);
391                                                         if(trace_startsolid)
392                                                         {
393                                                                 sprint(self, "Cannot move there, cheater - only waypoints set using g_waypointsprite_personal work\n");
394                                                         }
395                                                         else
396                                                         {
397                                                                 // Abort speedrun, teleport back
398                                                                 setorigin(self, self.personal.origin);
399                                                                 self.oldvelocity = self.velocity = self.personal.velocity;
400                                                                 self.angles = self.personal.v_angle;
401                                                                 self.fixangle = TRUE;
402                                                                 if(self.flagcarried)
403                                                                 {
404                                                                         bprint("The ", self.flagcarried.netname, " was returned to base by its carrier\n");
405                                                                         ReturnFlag(self.flagcarried);
406                                                                 }
407                                                         }
408                                                         if(g_ctf)
409                                                         {
410                                                                 self.ammo_rockets = 999;
411                                                                 self.ammo_nails = 999;
412                                                                 self.ammo_cells = 999;
413                                                                 self.ammo_shells = 999;
414                                                                 self.ammo_fuel = 999;
415                                                                 self.health = start_health;
416                                                                 self.armorvalue = start_armorvalue;
417                                                                 self.weapons |= weaponsInMap;
418                                                                 self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
419                                                                 self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
420                                                                 self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
421                                                                 self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
422                                                                 self.strength_finished = 0;
423                                                                 self.invincible_finished = 0;
424                                                         }
425                                                         else
426                                                         {
427                                                                 self.ammo_rockets = self.personal.ammo_rockets;
428                                                                 self.ammo_nails = self.personal.ammo_nails;
429                                                                 self.ammo_cells = self.personal.ammo_cells;
430                                                                 self.ammo_shells = self.personal.ammo_shells;
431                                                                 self.ammo_fuel = self.personal.ammo_fuel;
432                                                                 self.health = self.personal.health;
433                                                                 self.armorvalue = self.personal.armorvalue;
434                                                                 self.weapons = self.personal.weapons;
435                                                                 self.items = self.personal.items;
436                                                                 self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
437                                                                 self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
438                                                                 self.pauserotfuel_finished = time + self.personal.pauserotfuel_finished - self.personal.teleport_time;
439                                                                 self.pauseregen_finished = time + self.personal.pauseregen_finished - self.personal.teleport_time;
440                                                                 self.strength_finished = time + self.personal.strength_finished - self.personal.teleport_time;
441                                                                 self.invincible_finished = time + self.personal.invincible_finished - self.personal.teleport_time;
442                                                         }
443                                                 }
444                                                 else if(self.deadflag != DEAD_NO)
445                                                         sprint(self, "UR DEAD AHAHAH))\n");
446                                                 else
447                                                         sprint(self, "No waypoint set, cheater (use g_waypointsprite_personal to set one)\n");
448                                                 break;
449                                         case 143:
450                                                 if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((sv_cheats >= 2) ? 100000 : 100), 1024, 256))
451                                                 {
452                                                         self.angles_x = -self.angles_x;
453                                                         self.fixangle = TRUE;
454                                                         self.velocity = '0 0 0';
455                                                 }
456                                                 else
457                                                         sprint(self, "Emergency teleport could not find a good location, forget it!\n");
458                                                 break;
459                                         case 144:
460                                                 makevectors(self.v_angle);
461                                                 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * MAX_SHOT_DISTANCE, FALSE, self);
462                                                 if (trace_fraction < 1)
463                                                         printsurfaceinfo(trace_ent, trace_endpos);
464                                                 break;
465                                         case 145:
466                                                 makevectors(self.v_angle);
467                                                 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 65536, FALSE, self);
468                                                 sprint(self, strcat("distance: ", ftos(fabs(vlen(trace_endpos - (self.origin + self.view_ofs)))), "\n"));
469                                                 break;
470                                         case 146:
471                                                 makevectors(self.v_angle);
472                                                 i = self.dphitcontentsmask;
473                                                 self.dphitcontentsmask = DPCONTENTS_OPAQUE;
474                                                 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 65536, FALSE, self);
475                                                 self.dphitcontentsmask = i;
476                                                 sprint(self, strcat("distance: ", ftos(fabs(vlen(trace_endpos - (self.origin + self.view_ofs)))), "\n"));
477                                                 pointparticles(particleeffectnum("fire_big"), trace_endpos, '0 0 0', 10);
478                                                 break;
479                                         case 148:
480                                                 FOR_EACH_PLAYER(e)
481                                                 {
482                                                         if( e.playermodel == "models/player/jeandarc.zym"
483                                                         ||  e.playermodel == "models/player/pyria.zym"
484                                                         ||  e.playermodel == "models/player/skadi.zym"
485                                                         || (e.playermodel == "models/player/specop.zym" && random() < 0.5) // you never know
486                                                         ||  e.playermodel == "models/player/visitant.zym")
487                                                         {
488                                                                 makevectors(e.angles);
489                                                                 traceline(e.origin, e.origin + v_right * 256, MOVE_NORMAL, e);
490                                                         }
491                                                         else
492                                                         {
493                                                                 org_x = random();
494                                                                 org_y = random();
495                                                                 org_z = 0;
496                                                                 org = normalize(org);
497                                                                 traceline(e.origin, e.origin + org * 256, MOVE_NORMAL, e); // random direction
498                                                         }
499
500                                                         org = findbetterlocation(trace_endpos, 12);
501
502                                                         e2 = spawn();
503                                                         setorigin(e2, org);
504                                                         pointparticles(particleeffectnum("rocket_explode"), org, '0 0 0', 1);
505                                                         sound(e2, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
506                                                         RadiusDamage(e2, e, 1000, 0, 128, e, 500, DEATH_CHEAT, world);
507                                                         remove(e2);
508                                                 }
509                                                 print("404 Sportsmanship not found.\n");
510                                                 break;
511                                 }
512                         }
513                 }
514         }
515         else if(imp >= 103 && imp <= 107)
516         {
517                 if(cvar("g_waypointeditor"))
518                 {
519                         switch(imp)
520                         {
521                                 case 103:
522                                         waypoint_schedulerelink(waypoint_spawn(self.origin, self.origin, 0));
523                                         bprint(strcat("Waypoint spawned at ",vtos(self.origin),"\n"));
524                                         break;
525                                 case 104:
526                                         e = navigation_findnearestwaypoint(self, FALSE);
527                                         if (e)
528                                         if not(e.wpflags & WAYPOINTFLAG_GENERATED)
529                                         {
530                                                 bprint(strcat("Waypoint removed at ",vtos(e.origin),"\n"));
531                                                 waypoint_remove(e);
532                                         }
533                                         break;
534                                 case 105:
535                                         waypoint_schedulerelinkall();
536                                         break;
537                                 case 106:
538                                         waypoint_saveall();
539                                         break;
540                                 case 107:
541                                         for(e = findchain(classname, "waypoint"); e; e = e.chain)
542                                         {
543                                                 e.colormod_x = 1;
544                                                 e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
545                                         }
546                                         e2 = navigation_findnearestwaypoint(self, FALSE);
547                                         navigation_markroutes(e2);
548                                         i = 0;
549                                         for(e = findchain(classname, "waypoint"); e; e = e.chain)
550                                         {
551                                                 if(e.wpcost >= 10000000)
552                                                 {
553                                                         print("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
554                                                         e.colormod_x = 0.1;
555                                                         e.effects |= EF_NODEPTHTEST | EF_BLUE;
556                                                         ++i;
557                                                 }
558                                         }
559                                         if(i)
560                                                 print(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
561                                         navigation_markroutes_inverted(e2);
562                                         i = 0;
563                                         for(e = findchain(classname, "waypoint"); e; e = e.chain)
564                                         {
565                                                 if(e.wpcost >= 10000000)
566                                                 {
567                                                         print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
568                                                         e.colormod_x = 0.1;
569                                                         e.effects |= EF_NODEPTHTEST | EF_RED;
570                                                         ++i;
571                                                 }
572                                         }
573                                         if(i)
574                                                 print(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
575                                         i = 0;
576                                         for(e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
577                                         {
578                                                 if(navigation_findnearestwaypoint(e, FALSE))
579                                                 {
580                                                         e.effects &~= EF_NODEPTHTEST;
581                                                         e.model = "";
582                                                 }
583                                                 else
584                                                 {
585                                                         print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
586                                                         e.effects |= EF_NODEPTHTEST;
587                                                         setmodel(e, self.model);
588                                                         e.frame = self.frame;
589                                                         e.skin = self.skin;
590                                                         setsize(e, '0 0 0', '0 0 0');
591                                                         ++i;
592                                                 }
593                                         }
594                                         if(i)
595                                                 print(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
596                                         break;
597                         }
598                 }
599         }
600 #ifdef TETRIS
601         else if(imp == 100)
602                 TetrisImpulse();
603 #endif
604 }