1a5c3f09ab03aa5f51ec97d3b98ff386861781b9
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / walker.qc
1 #ifndef TURRET_WALKER_H
2 #define TURRET_WALKER_H
3
4 //#define WALKER_FANCYPATHING
5
6 #include "walker_weapon.qh"
7
8 CLASS(WalkerTurret, Turret)
9 /* spawnflags */ ATTRIB(WalkerTurret, spawnflags, int, TUR_FLAG_PLAYER | TUR_FLAG_MOVE);
10 /* mins       */ ATTRIB(WalkerTurret, mins, vector, '-70 -70 0');
11 /* maxs       */ ATTRIB(WalkerTurret, maxs, vector, '70 70 95');
12 /* modelname  */ ATTRIB(WalkerTurret, mdl, string, "walker_body.md3");
13 /* model      */ ATTRIB_STRZONE(WalkerTurret, model, string, strcat("models/turrets/", this.mdl));
14 /* head_model */ ATTRIB_STRZONE(WalkerTurret, head_model, string, strcat("models/turrets/", "walker_head_minigun.md3"));
15 /* netname    */ ATTRIB(WalkerTurret, netname, string, "walker");
16 /* fullname   */ ATTRIB(WalkerTurret, turret_name, string, _("Walker Turret"));
17     ATTRIB(WalkerTurret, m_weapon, Weapon, WEP_WALKER);
18 ENDCLASS(WalkerTurret)
19 REGISTER_TURRET(WALKER, NEW(WalkerTurret));
20
21 #endif
22
23 #ifdef IMPLEMENTATION
24
25 #ifdef SVQC
26
27 float autocvar_g_turrets_unit_walker_melee_damage;
28 float autocvar_g_turrets_unit_walker_melee_force;
29 float autocvar_g_turrets_unit_walker_melee_range;
30 float autocvar_g_turrets_unit_walker_rocket_damage;
31 float autocvar_g_turrets_unit_walker_rocket_radius;
32 float autocvar_g_turrets_unit_walker_rocket_force;
33 float autocvar_g_turrets_unit_walker_rocket_speed;
34 float autocvar_g_turrets_unit_walker_rocket_range;
35 float autocvar_g_turrets_unit_walker_rocket_range_min;
36 float autocvar_g_turrets_unit_walker_rocket_refire;
37 float autocvar_g_turrets_unit_walker_rocket_turnrate;
38 float autocvar_g_turrets_unit_walker_speed_stop;
39 float autocvar_g_turrets_unit_walker_speed_walk;
40 float autocvar_g_turrets_unit_walker_speed_run;
41 float autocvar_g_turrets_unit_walker_speed_jump;
42 float autocvar_g_turrets_unit_walker_speed_swim;
43 float autocvar_g_turrets_unit_walker_speed_roam;
44 float autocvar_g_turrets_unit_walker_turn;
45 float autocvar_g_turrets_unit_walker_turn_walk;
46 float autocvar_g_turrets_unit_walker_turn_strafe;
47 float autocvar_g_turrets_unit_walker_turn_swim;
48 float autocvar_g_turrets_unit_walker_turn_run;
49
50 const int ANIM_NO         = 0;
51 const int ANIM_TURN       = 1;
52 const int ANIM_WALK       = 2;
53 const int ANIM_RUN        = 3;
54 const int ANIM_STRAFE_L   = 4;
55 const int ANIM_STRAFE_R   = 5;
56 const int ANIM_JUMP       = 6;
57 const int ANIM_LAND       = 7;
58 const int ANIM_PAIN       = 8;
59 const int ANIM_MELEE      = 9;
60 const int ANIM_SWIM       = 10;
61 const int ANIM_ROAM       = 11;
62
63 .float animflag;
64 .float idletime;
65
66 #define WALKER_PATH(this, s, e) pathlib_astar(this, s, e)
67
68 bool walker_firecheck(entity this)
69 {
70     if (this.animflag == ANIM_MELEE)
71         return false;
72
73     return turret_firecheck(this);
74 }
75
76 void walker_melee_do_dmg(entity this)
77 {
78     vector where;
79     entity e;
80
81     makevectors(this.angles);
82     where = this.origin + v_forward * 128;
83
84     e = findradius(where,32);
85     while (e)
86     {
87         if (turret_validate_target(this, e, this.target_validate_flags))
88             if (e != this && e.owner != this)
89                 Damage(e, this, this, (autocvar_g_turrets_unit_walker_melee_damage), DEATH_TURRET_WALK_MELEE.m_id, '0 0 0', v_forward * (autocvar_g_turrets_unit_walker_melee_force));
90
91         e = e.chain;
92     }
93 }
94
95 void walker_setnoanim(entity this)
96 {
97     turrets_setframe(this, ANIM_NO, false);
98     this.animflag = this.frame;
99 }
100 void walker_rocket_explode(entity this)
101 {
102     RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, NULL, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, NULL);
103     remove (this);
104 }
105
106 void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
107 {
108     this.health = this.health - damage;
109     this.velocity = this.velocity + vforce;
110
111     if (this.health <= 0)
112         W_PrepareExplosionByDamage(this, this.owner, walker_rocket_explode);
113 }
114
115 #define WALKER_ROCKET_MOVE(s) movelib_move_simple((s), newdir, (autocvar_g_turrets_unit_walker_rocket_speed), (autocvar_g_turrets_unit_walker_rocket_turnrate)); UpdateCSQCProjectile(s)
116 void walker_rocket_loop(entity this);
117 void walker_rocket_think(entity this)
118 {
119     vector newdir;
120     float edist;
121     float itime;
122     float m_speed;
123
124     this.nextthink = time;
125
126     edist = vlen(this.enemy.origin - this.origin);
127
128     // Simulate crude guidance
129     if (this.cnt < time)
130     {
131         if (edist < 1000)
132             this.tur_shotorg = randomvec() * min(edist, 64);
133         else
134             this.tur_shotorg = randomvec() * min(edist, 256);
135
136         this.cnt = time + 0.5;
137     }
138
139     if (edist < 128)
140         this.tur_shotorg = '0 0 0';
141
142     if (this.max_health < time)
143     {
144         setthink(this, walker_rocket_explode);
145         this.nextthink  = time;
146         return;
147     }
148
149     if (this.shot_dmg != 1337 && random() < 0.01)
150     {
151         walker_rocket_loop(this);
152         return;
153     }
154
155     m_speed = vlen(this.velocity);
156
157     // Enemy dead? just keep on the current heading then.
158     if (this.enemy == NULL || IS_DEAD(this.enemy))
159         this.enemy = NULL;
160
161     if (this.enemy)
162     {
163         itime = max(edist / m_speed, 1);
164         newdir = steerlib_pull(this, this.enemy.origin + this.tur_shotorg);
165     }
166     else
167         newdir  = normalize(this.velocity);
168
169     WALKER_ROCKET_MOVE(this);
170 }
171
172 void walker_rocket_loop3(entity this)
173 {
174     this.nextthink = time;
175
176     if (this.max_health < time)
177     {
178         setthink(this, walker_rocket_explode);
179         return;
180     }
181
182     if(vdist(this.origin - this.tur_shotorg, <, 100))
183     {
184         setthink(this, walker_rocket_think);
185         return;
186     }
187
188     vector newdir = steerlib_pull(this, this.tur_shotorg);
189     WALKER_ROCKET_MOVE(this);
190
191     this.angles = vectoangles(this.velocity);
192 }
193
194 void walker_rocket_loop2(entity this)
195 {
196     this.nextthink = time;
197
198     if (this.max_health < time)
199     {
200         setthink(this, walker_rocket_explode);
201         return;
202     }
203
204     if(vdist(this.origin - this.tur_shotorg, <, 100))
205     {
206         this.tur_shotorg = this.origin - '0 0 200';
207         setthink(this, walker_rocket_loop3);
208         return;
209     }
210
211     vector newdir = steerlib_pull(this, this.tur_shotorg);
212     WALKER_ROCKET_MOVE(this);
213 }
214
215 void walker_rocket_loop(entity this)
216 {
217     this.nextthink = time;
218     this.tur_shotorg = this.origin + '0 0 300';
219     setthink(this, walker_rocket_loop2);
220     this.shot_dmg = 1337;
221 }
222
223 void walker_fire_rocket(entity this, vector org)
224 {
225     fixedmakevectors(this.angles);
226
227     te_explosion (org);
228
229     entity rocket = new(walker_rocket);
230     setorigin(rocket, org);
231
232     sound (this, CH_WEAPON_A, SND_HAGAR_FIRE, VOL_BASE, ATTEN_NORM);
233     setsize (rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
234
235     rocket.owner                          = this;
236     rocket.bot_dodge              = true;
237     rocket.bot_dodgerating      = 50;
238     rocket.takedamage            = DAMAGE_YES;
239     rocket.damageforcescale   = 2;
240     rocket.health                        = 25;
241     rocket.tur_shotorg          = randomvec() * 512;
242     rocket.cnt                          = time + 1;
243     rocket.enemy                          = this.enemy;
244
245     if (random() < 0.01)
246         setthink(rocket, walker_rocket_loop);
247     else
248         setthink(rocket, walker_rocket_think);
249
250     rocket.event_damage    = walker_rocket_damage;
251
252     rocket.nextthink              = time;
253     rocket.movetype                = MOVETYPE_FLY;
254     rocket.velocity                = normalize((v_forward + v_up * 0.5) + (randomvec() * 0.2)) * (autocvar_g_turrets_unit_walker_rocket_speed);
255     rocket.angles                        = vectoangles(rocket.velocity);
256     settouch(rocket, walker_rocket_explode);
257     rocket.flags                          = FL_PROJECTILE;
258     rocket.solid                          = SOLID_BBOX;
259     rocket.max_health            = time + 9;
260     rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
261
262     CSQCProjectile(rocket, false, PROJECTILE_ROCKET, false); // no culling, has fly sound
263 }
264
265 .vector enemy_last_loc;
266 .float enemy_last_time;
267 void walker_move_to(entity this, vector _target, float _dist)
268 {
269     switch (this.waterlevel)
270     {
271         case WATERLEVEL_NONE:
272             if (_dist > 500)
273                 this.animflag = ANIM_RUN;
274             else
275                 this.animflag = ANIM_WALK;
276         case WATERLEVEL_WETFEET:
277         case WATERLEVEL_SWIMMING:
278             if (this.animflag != ANIM_SWIM)
279                 this.animflag = ANIM_WALK;
280             else
281                 this.animflag = ANIM_SWIM;
282             break;
283         case WATERLEVEL_SUBMERGED:
284             this.animflag = ANIM_SWIM;
285     }
286
287     this.moveto = _target;
288     this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
289
290     if(this.enemy)
291     {
292         this.enemy_last_loc = _target;
293         this.enemy_last_time = time;
294     }
295 }
296
297 void walker_move_path(entity this)
298 {
299 #ifdef WALKER_FANCYPATHING
300     // Are we close enougth to a path node to switch to the next?
301     if(vdist(this.origin - this.pathcurrent.origin, <, 64))
302         if (this.pathcurrent.path_next == NULL)
303         {
304             // Path endpoint reached
305             pathlib_deletepath(this.pathcurrent.owner);
306             this.pathcurrent = NULL;
307
308             if (this.pathgoal)
309             {
310                 if (this.pathgoal.use)
311                     this.pathgoal.use(this, NULL, NULL);
312
313                 if (this.pathgoal.enemy)
314                 {
315                     this.pathcurrent = WALKER_PATH(this, this.pathgoal.origin, this.pathgoal.enemy.origin);
316                     this.pathgoal = this.pathgoal.enemy;
317                 }
318             }
319             else
320                 this.pathgoal = NULL;
321         }
322         else
323             this.pathcurrent = this.pathcurrent.path_next;
324
325     this.moveto = this.pathcurrent.origin;
326     this.steerto = steerlib_attract2(this, this.moveto,0.5,500,0.95);
327     walker_move_to(this, this.moveto, 0);
328
329 #else
330     if(vdist(this.origin - this.pathcurrent.origin, <, 64))
331         this.pathcurrent = this.pathcurrent.enemy;
332
333     if(!this.pathcurrent)
334         return;
335
336     this.moveto = this.pathcurrent.origin;
337     this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
338     walker_move_to(this, this.moveto, 0);
339 #endif
340 }
341
342 spawnfunc(turret_walker) { if(!turret_initialize(this, TUR_WALKER)) remove(this); }
343
344 METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
345 {
346     fixedmakevectors(it.angles);
347
348     if (it.spawnflags & TSF_NO_PATHBREAK && it.pathcurrent)
349         walker_move_path(it);
350     else if (it.enemy == NULL)
351     {
352         if(it.pathcurrent)
353             walker_move_path(it);
354         else
355         {
356             if(it.enemy_last_time != 0)
357             {
358                 if(vdist(it.origin - it.enemy_last_loc, <, 128) || time - it.enemy_last_time > 10)
359                     it.enemy_last_time = 0;
360                 else
361                     walker_move_to(it, it.enemy_last_loc, 0);
362             }
363             else
364             {
365                 if(it.animflag != ANIM_NO)
366                 {
367                     traceline(it.origin + '0 0 64', it.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, it);
368
369                     if(trace_fraction != 1.0)
370                         it.tur_head.idletime = -1337;
371                     else
372                     {
373                         traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, it);
374                         if(trace_fraction == 1.0)
375                             it.tur_head.idletime = -1337;
376                     }
377
378                     if(it.tur_head.idletime == -1337)
379                     {
380                         it.moveto = it.origin + randomvec() * 256;
381                         it.tur_head.idletime = 0;
382                     }
383
384                     it.moveto = it.moveto * 0.9 + ((it.origin + v_forward * 500) + randomvec() * 400) * 0.1;
385                     it.moveto_z = it.origin_z + 64;
386                     walker_move_to(it, it.moveto, 0);
387                 }
388
389                 if(it.idletime < time)
390                 {
391                     if(random() < 0.5 || !(it.spawnflags & TSL_ROAM))
392                     {
393                         it.idletime = time + 1 + random() * 5;
394                         it.moveto = it.origin;
395                         it.animflag = ANIM_NO;
396                     }
397                     else
398                     {
399                         it.animflag = ANIM_WALK;
400                         it.idletime = time + 4 + random() * 2;
401                         it.moveto = it.origin + randomvec() * 256;
402                         it.tur_head.moveto = it.moveto;
403                         it.tur_head.idletime = 0;
404                     }
405                 }
406             }
407         }
408     }
409     else
410     {
411         if (it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_melee_range) && it.animflag != ANIM_MELEE)
412         {
413             vector wish_angle;
414
415             wish_angle = angleofs(it, it.enemy);
416             if (it.animflag != ANIM_SWIM)
417             if (fabs(wish_angle_y) < 15)
418             {
419                 it.moveto   = it.enemy.origin;
420                 it.steerto  = steerlib_attract2(it, it.moveto, 0.5, 500, 0.95);
421                 it.animflag = ANIM_MELEE;
422             }
423         }
424         else if (it.tur_head.attack_finished_single[0] < time)
425         {
426             if(it.tur_head.shot_volly)
427             {
428                 it.animflag = ANIM_NO;
429
430                 it.tur_head.shot_volly = it.tur_head.shot_volly -1;
431                 if(it.tur_head.shot_volly == 0)
432                     it.tur_head.attack_finished_single[0] = time + (autocvar_g_turrets_unit_walker_rocket_refire);
433                 else
434                     it.tur_head.attack_finished_single[0] = time + 0.2;
435
436                 if(it.tur_head.shot_volly > 1)
437                     walker_fire_rocket(it, gettaginfo(it, gettagindex(it, "tag_rocket01")));
438                 else
439                     walker_fire_rocket(it, gettaginfo(it, gettagindex(it, "tag_rocket02")));
440             }
441             else
442             {
443                 if (it.tur_dist_enemy > (autocvar_g_turrets_unit_walker_rocket_range_min))
444                 if (it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_rocket_range))
445                     it.tur_head.shot_volly = 4;
446             }
447         }
448         else
449         {
450             if (it.animflag != ANIM_MELEE)
451                 walker_move_to(it, it.enemy.origin, it.tur_dist_enemy);
452         }
453     }
454
455     {
456         vector real_angle;
457         float turny = 0, turnx = 0;
458         float vz;
459
460         real_angle = vectoangles(it.steerto) - it.angles;
461         vz = it.velocity_z;
462
463         switch (it.animflag)
464         {
465             case ANIM_NO:
466                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
467                 break;
468
469             case ANIM_TURN:
470                 turny = (autocvar_g_turrets_unit_walker_turn);
471                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
472                 break;
473
474             case ANIM_WALK:
475                 turny = (autocvar_g_turrets_unit_walker_turn_walk);
476                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_walk), 0.6);
477                 break;
478
479             case ANIM_RUN:
480                 turny = (autocvar_g_turrets_unit_walker_turn_run);
481                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_run), 0.6);
482                 break;
483
484             case ANIM_STRAFE_L:
485                 turny = (autocvar_g_turrets_unit_walker_turn_strafe);
486                 movelib_move_simple(it, v_right * -1, (autocvar_g_turrets_unit_walker_speed_walk), 0.8);
487                 break;
488
489             case ANIM_STRAFE_R:
490                 turny = (autocvar_g_turrets_unit_walker_turn_strafe);
491                 movelib_move_simple(it, v_right, (autocvar_g_turrets_unit_walker_speed_walk), 0.8);
492                 break;
493
494             case ANIM_JUMP:
495                 it.velocity += '0 0 1' * (autocvar_g_turrets_unit_walker_speed_jump);
496                 break;
497
498             case ANIM_LAND:
499                 break;
500
501             case ANIM_PAIN:
502                 if(it.frame != ANIM_PAIN)
503                     defer(it, 0.25, walker_setnoanim);
504
505                 break;
506
507             case ANIM_MELEE:
508                 if(it.frame != ANIM_MELEE)
509                 {
510                     defer(it, 0.41, walker_setnoanim);
511                     defer(it, 0.21, walker_melee_do_dmg);
512                 }
513
514                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
515                 break;
516
517             case ANIM_SWIM:
518                 turny = (autocvar_g_turrets_unit_walker_turn_swim);
519                 turnx = (autocvar_g_turrets_unit_walker_turn_swim);
520
521                 it.angles_x += bound(-10, shortangle_f(real_angle_x, it.angles_x), 10);
522                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_swim), 0.3);
523                 vz = it.velocity_z + sin(time * 4) * 8;
524                 break;
525
526             case ANIM_ROAM:
527                 turny = (autocvar_g_turrets_unit_walker_turn_walk);
528                 movelib_move_simple(it, v_forward ,(autocvar_g_turrets_unit_walker_speed_roam), 0.5);
529                 break;
530         }
531
532         if(turny)
533         {
534             turny = bound( turny * -1, shortangle_f(real_angle_y, it.angles_y), turny );
535             it.angles_y += turny;
536         }
537
538         if(turnx)
539         {
540             turnx = bound( turnx * -1, shortangle_f(real_angle_x, it.angles_x), turnx );
541             it.angles_x += turnx;
542         }
543
544         it.velocity_z = vz;
545     }
546
547
548     if(it.origin != it.oldorigin)
549         it.SendFlags |= TNSF_MOVE;
550
551     it.oldorigin = it.origin;
552     turrets_setframe(it, it.animflag, false);
553 }
554 METHOD(WalkerTurret, tr_death, void(WalkerTurret this, entity it))
555 {
556 #ifdef WALKER_FANCYPATHING
557     if (it.pathcurrent)
558         pathlib_deletepath(it.pathcurrent.owner);
559 #endif
560     it.pathcurrent = NULL;
561 }
562 METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
563 {
564     it.ticrate = 0.05;
565
566     entity e;
567
568     // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
569     if(it.movetype == MOVETYPE_WALK)
570     {
571         if(it.pos1)
572             setorigin(it, it.pos1);
573         if(it.pos2)
574             it.angles = it.pos2;
575     }
576
577     it.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
578     it.aim_flags = TFL_AIM_LEAD;
579     it.turret_flags |= TUR_FLAG_HITSCAN;
580
581     it.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
582     it.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
583     it.iscreature = true;
584     it.teleportable = TELEPORT_NORMAL;
585     it.damagedbycontents = true;
586     it.solid = SOLID_SLIDEBOX;
587     it.takedamage = DAMAGE_AIM;
588     if(it.movetype != MOVETYPE_WALK)
589     {
590         setorigin(it, it.origin);
591         tracebox(it.origin + '0 0 128', it.mins, it.maxs, it.origin - '0 0 10000', MOVE_NORMAL, it);
592         setorigin(it, trace_endpos + '0 0 4');
593         it.pos1 = it.origin;
594         it.pos2 = it.angles;
595     }
596     it.movetype = MOVETYPE_WALK;
597     it.idle_aim = '0 0 0';
598     it.turret_firecheckfunc = walker_firecheck;
599
600     if (it.target != "")
601     {
602         e = find(NULL, targetname, it.target);
603         if (!e)
604         {
605             LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
606             it.target = "";
607         }
608
609         if (e.classname != "turret_checkpoint")
610             LOG_TRACE("Warning: not a turrret path\n");
611         else
612         {
613 #ifdef WALKER_FANCYPATHING
614             it.pathcurrent = WALKER_PATH(it, it.origin, e.origin);
615             it.pathgoal = e;
616 #else
617             it.pathcurrent = e;
618 #endif
619         }
620     }
621 }
622
623 #endif // SVQC
624 #ifdef CSQC
625
626 #include <common/physics/movelib.qh>
627
628 void walker_draw(entity this)
629 {
630     float dt;
631
632     dt = time - this.move_time;
633     this.move_time = time;
634     if(dt <= 0)
635         return;
636
637     fixedmakevectors(this.angles);
638     movelib_groundalign4point(this, 300, 100, 0.25, 45);
639     setorigin(this, this.origin + this.velocity * dt);
640     this.tur_head.angles += dt * this.tur_head.move_avelocity;
641     this.angles_y = this.move_angles_y;
642
643     if (this.health < 127)
644     if(random() < 0.15)
645         te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
646 }
647
648         METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
649         {
650             it.gravity          = 1;
651             it.movetype         = MOVETYPE_BOUNCE;
652             it.move_movetype    = MOVETYPE_BOUNCE;
653             it.move_origin      = it.origin;
654             it.move_time                = time;
655             it.draw                     = walker_draw;
656         }
657
658 #endif // CSQC
659 #endif