Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / weapons / projectile.qc
1 #include "projectile.qh"
2
3 #include "../autocvars.qh"
4 #include "../defs.qh"
5 #include "../main.qh"
6
7 #include "../../common/constants.qh"
8 #include "../../common/nades.qh"
9 #include "../../common/movetypes/movetypes.qh"
10 #include "../../common/util.qh"
11
12 #include "../../csqcmodellib/interpolate.qh"
13
14 #include "../../warpzonelib/anglestransform.qh"
15
16 .float alpha;
17 .float scale;
18 .vector colormod;
19
20 void SUB_Stop()
21 {
22         self.move_velocity = self.move_avelocity = '0 0 0';
23         self.move_movetype = MOVETYPE_NONE;
24 }
25
26 void Projectile_ResetTrail(vector to)
27 {
28         self.trail_oldorigin = to;
29         self.trail_oldtime = time;
30 }
31
32 void Projectile_DrawTrail(vector to)
33 {
34         vector from;
35         float t0;
36
37         from = self.trail_oldorigin;
38         t0 = self.trail_oldtime;
39         self.trail_oldorigin = to;
40         self.trail_oldtime = time;
41
42         // force the effect even for stationary firemine
43         if(self.cnt == PROJECTILE_FIREMINE)
44                 if(from == to)
45                         from.z += 1;
46
47         if (self.traileffect)
48         {
49                 particles_alphamin = particles_alphamax = particles_fade = sqrt(self.alpha);
50                 boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL);
51         }
52 }
53
54 void Projectile_Draw()
55 {
56         vector rot;
57         vector trailorigin;
58         int f;
59         bool drawn;
60         float t;
61         float a;
62
63         f = self.move_flags;
64
65         if(self.count & 0x80)
66         {
67                 //self.move_flags &= ~FL_ONGROUND;
68                 if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
69                         Movetype_Physics_NoMatchServer();
70                         // the trivial movetypes do not have to match the
71                         // server's ticrate as they are ticrate independent
72                         // NOTE: this assumption is only true if MOVETYPE_FLY
73                         // projectiles detonate on impact. If they continue
74                         // moving, we might still be ticrate dependent.
75                 else
76                         Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
77                 if(!(self.move_flags & FL_ONGROUND))
78                         if(self.velocity != '0 0 0')
79                                 self.move_angles = self.angles = vectoangles(self.velocity);
80         }
81         else
82         {
83                 InterpolateOrigin_Do();
84         }
85
86         if(self.count & 0x80)
87         {
88                 drawn = (time >= self.spawntime - 0.02);
89                 t = max(time, self.spawntime);
90         }
91         else
92         {
93                 drawn = (self.iflags & IFLAG_VALID);
94                 t = time;
95         }
96
97         if(!(f & FL_ONGROUND))
98         {
99                 rot = '0 0 0';
100                 switch(self.cnt)
101                 {
102                         /*
103                         case PROJECTILE_GRENADE:
104                                 rot = '-2000 0 0'; // forward
105                                 break;
106                         */
107                         case PROJECTILE_GRENADE_BOUNCING:
108                                 rot = '0 -1000 0'; // sideways
109                                 break;
110                         case PROJECTILE_HOOKBOMB:
111                                 rot = '1000 0 0'; // forward
112                                 break;
113                         default:
114                                 break;
115                 }
116
117                 if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
118                         rot = self.avelocity;
119
120                 self.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(self.angles), rot * (t - self.spawntime)));
121         }
122
123         vector ang;
124         ang = self.angles;
125         ang.x = -ang.x;
126         makevectors(ang);
127
128         a = 1 - (time - self.fade_time) * self.fade_rate;
129         self.alpha = bound(0, self.alphamod * a, 1);
130         if(self.alpha <= 0)
131                 drawn = 0;
132         self.renderflags = 0;
133
134         trailorigin = self.origin;
135         switch(self.cnt)
136         {
137                 case PROJECTILE_GRENADE:
138                 case PROJECTILE_GRENADE_BOUNCING:
139                         trailorigin += v_right * 1 + v_forward * -10;
140                         break;
141                 default:
142                         break;
143         }
144
145         if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
146                 trailorigin += v_up * 4;
147
148         if(drawn)
149                 Projectile_DrawTrail(trailorigin);
150         else
151                 Projectile_ResetTrail(trailorigin);
152
153         self.drawmask = 0;
154
155         if(!drawn)
156                 return;
157
158         switch(self.cnt)
159         {
160                 // Possibly add dlights here.
161                 default:
162                         break;
163         }
164
165         self.drawmask = MASK_NORMAL;
166 }
167
168 void loopsound(entity e, int ch, string samp, float vol, float attn)
169 {
170         if(self.silent)
171                 return;
172
173         sound(e, ch, samp, vol, attn);
174         e.snd_looping = ch;
175 }
176
177 void Ent_RemoveProjectile()
178 {
179         if(self.count & 0x80)
180         {
181                 tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.05, MOVE_NORMAL, self);
182                 Projectile_DrawTrail(trace_endpos);
183         }
184 }
185
186 void Ent_Projectile()
187 {
188         int f;
189
190         // projectile properties:
191         //   kind (interpolated, or clientside)
192         //
193         //   modelindex
194         //   origin
195         //   scale
196         //   if clientside:
197         //     velocity
198         //     gravity
199         //   soundindex (hardcoded list)
200         //   effects
201         //
202         // projectiles don't send angles, because they always follow the velocity
203
204         f = ReadByte();
205         self.count = (f & 0x80);
206         self.iflags = (self.iflags & IFLAG_INTERNALMASK) | IFLAG_AUTOANGLES | IFLAG_ANGLES | IFLAG_ORIGIN;
207         self.solid = SOLID_TRIGGER;
208         //self.effects = EF_NOMODELFLAGS;
209
210         // this should make collisions with bmodels more exact, but it leads to
211         // projectiles no longer being able to lie on a bmodel
212         self.move_nomonsters = MOVE_WORLDONLY;
213         if(f & 0x40)
214                 self.move_flags |= FL_ONGROUND;
215         else
216                 self.move_flags &= ~FL_ONGROUND;
217
218         if(!self.move_time)
219         {
220                 // for some unknown reason, we don't need to care for
221                 // sv_gameplayfix_delayprojectiles here.
222                 self.move_time = time;
223                 self.spawntime = time;
224         }
225         else
226                 self.move_time = max(self.move_time, time);
227
228         if(!(self.count & 0x80))
229                 InterpolateOrigin_Undo();
230
231         if(f & 1)
232         {
233                 self.origin_x = ReadCoord();
234                 self.origin_y = ReadCoord();
235                 self.origin_z = ReadCoord();
236                 setorigin(self, self.origin);
237                 if(self.count & 0x80)
238                 {
239                         self.velocity_x = ReadCoord();
240                         self.velocity_y = ReadCoord();
241                         self.velocity_z = ReadCoord();
242                         if(f & 0x10)
243                                 self.gravity = ReadCoord();
244                         else
245                                 self.gravity = 0; // none
246                         self.move_origin = self.origin;
247                         self.move_velocity = self.velocity;
248                 }
249
250                 if(time == self.spawntime || (self.count & 0x80) || (f & 0x08))
251                 {
252                         self.trail_oldorigin = self.origin;
253                         if(!(self.count & 0x80))
254                                 InterpolateOrigin_Reset();
255                 }
256
257                 if(f & 0x20)
258                 {
259                         self.fade_time = time + ReadByte() * ticrate;
260                         self.fade_rate = 1 / (ReadByte() * ticrate);
261                 }
262                 else
263                 {
264                         self.fade_time = 0;
265                         self.fade_rate = 0;
266                 }
267
268                 self.team = ReadByte() - 1;
269         }
270
271         if(f & 2)
272         {
273                 string rm_suffix = strcat("rocketminsta_laser_", Static_Team_ColorName_Lower(self.team));
274                 if(_particleeffectnum(rm_suffix) < 0 || Team_TeamToNumber(self.team) == -1) { rm_suffix = "TR_NEXUIZPLASMA"; }
275
276                 self.cnt = ReadByte();
277
278                 self.silent = (self.cnt & 0x80);
279                 self.cnt = (self.cnt & 0x7F);
280
281                 self.scale = 1;
282                 self.traileffect = 0;
283                 switch(self.cnt)
284                 {
285                         case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
286                         case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); self.scale = 2; break;
287                         case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
288                         case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
289                         case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
290                         case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
291                         case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
292                         case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
293                         case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_NULL); break;
294                         case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_NULL); break;
295                         case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
296                         case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
297                         case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); break;
298                         case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break;
299                         case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break;
300                         case PROJECTILE_NAPALM_FOUNTAIN: //self.model = ""; self.modelindex = 0; self.traileffect = _particleeffectnum("torch_small"); break;
301                         case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREBALL); break; // particle effect is good enough
302                         case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREMINE); break; // particle effect is good enough
303                         case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
304                         case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum(EFFECT_FLAC_TRAIL); break;
305                         case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum(EFFECT_SEEKER_TRAIL); break;
306
307                         case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); break;
308                         case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
309
310                         case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break;
311                         case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break;
312                         case PROJECTILE_RAPTORCANNON:  setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
313
314                         case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum(EFFECT_SPIDERBOT_ROCKET_TRAIL); break;
315                         case PROJECTILE_WAKIROCKET:   setmodel(self, "models/vehicles/rocket01.md3");  self.traileffect = particleeffectnum(EFFECT_RACER_ROCKET_TRAIL); break;
316                         case PROJECTILE_WAKICANNON:   setmodel(self, "models/laser.mdl");  self.traileffect = particleeffectnum(EFFECT_NULL); break;
317
318                         case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
319                         case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
320
321                         case PROJECTILE_RPC: setmodel(self, W_Model("ok_rocket"));self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
322
323                         case PROJECTILE_ROCKETMINSTA_LASER: setmodel(self, "models/elaser.mdl");self.traileffect = _particleeffectnum(rm_suffix); break;
324
325                         default:
326                                 if(MUTATOR_CALLHOOK(Ent_Projectile, self))
327                                         break;
328
329                                 if (Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
330                                 {
331                                         setmodel(self, W_Model("v_ok_grenade.md3"));
332                                         self.traileffect = _particleeffectnum(Nade_TrailEffect(self.cnt, self.team));
333                                         break;
334                                 }
335                                 error("Received invalid CSQC projectile, can't work with this!");
336                                 break;
337                 }
338
339                 self.mins = '0 0 0';
340                 self.maxs = '0 0 0';
341                 self.colormod = '0 0 0';
342                 self.move_touch = SUB_Stop;
343                 self.move_movetype = MOVETYPE_TOSS;
344                 self.alphamod = 1;
345
346                 switch(self.cnt)
347                 {
348                         case PROJECTILE_ELECTRO:
349                                 // only new engines support sound moving with object
350                                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("electro_fly"), VOL_BASE, ATTEN_NORM);
351                                 self.mins = '0 0 -4';
352                                 self.maxs = '0 0 -4';
353                                 self.move_movetype = MOVETYPE_BOUNCE;
354                                 self.move_touch = func_null;
355                                 self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
356                                 self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
357                                 break;
358                         case PROJECTILE_RPC:
359                         case PROJECTILE_ROCKET:
360                                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("rocket_fly"), VOL_BASE, ATTEN_NORM);
361                                 self.mins = '-3 -3 -3';
362                                 self.maxs = '3 3 3';
363                                 break;
364                         case PROJECTILE_GRENADE:
365                                 self.mins = '-3 -3 -3';
366                                 self.maxs = '3 3 3';
367                                 break;
368                         case PROJECTILE_GRENADE_BOUNCING:
369                                 self.mins = '-3 -3 -3';
370                                 self.maxs = '3 3 3';
371                                 self.move_movetype = MOVETYPE_BOUNCE;
372                                 self.move_touch = func_null;
373                                 self.move_bounce_factor = g_balance_mortar_bouncefactor;
374                                 self.move_bounce_stopspeed = g_balance_mortar_bouncestop;
375                                 break;
376                         case PROJECTILE_SHAMBLER_LIGHTNING:
377                                 self.mins = '-8 -8 -8';
378                                 self.maxs = '8 8 8';
379                                 self.scale = 2.5;
380                                 self.avelocity = randomvec() * 720;
381                                 break;
382                         case PROJECTILE_MINE:
383                                 self.mins = '-4 -4 -4';
384                                 self.maxs = '4 4 4';
385                                 break;
386                         case PROJECTILE_PORTO_RED:
387                                 self.colormod = '2 1 1';
388                                 self.alphamod = 0.5;
389                                 self.move_movetype = MOVETYPE_BOUNCE;
390                                 self.move_touch = func_null;
391                                 break;
392                         case PROJECTILE_PORTO_BLUE:
393                                 self.colormod = '1 1 2';
394                                 self.alphamod = 0.5;
395                                 self.move_movetype = MOVETYPE_BOUNCE;
396                                 self.move_touch = func_null;
397                                 break;
398                         case PROJECTILE_HAGAR_BOUNCING:
399                                 self.move_movetype = MOVETYPE_BOUNCE;
400                                 self.move_touch = func_null;
401                                 break;
402                         case PROJECTILE_CRYLINK_BOUNCING:
403                                 self.move_movetype = MOVETYPE_BOUNCE;
404                                 self.move_touch = func_null;
405                                 break;
406                         case PROJECTILE_NAPALM_FOUNTAIN:
407                         case PROJECTILE_FIREBALL:
408                                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("fireball_fly2"), VOL_BASE, ATTEN_NORM);
409                                 self.mins = '-16 -16 -16';
410                                 self.maxs = '16 16 16';
411                                 break;
412                         case PROJECTILE_FIREMINE:
413                                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("fireball_fly"), VOL_BASE, ATTEN_NORM);
414                                 self.move_movetype = MOVETYPE_BOUNCE;
415                                 self.move_touch = func_null;
416                                 self.mins = '-4 -4 -4';
417                                 self.maxs = '4 4 4';
418                                 break;
419                         case PROJECTILE_TAG:
420                                 self.mins = '-2 -2 -2';
421                                 self.maxs = '2 2 2';
422                                 break;
423                         case PROJECTILE_FLAC:
424                                 self.mins = '-2 -2 -2';
425                                 self.maxs = '2 2 2';
426                                 break;
427                         case PROJECTILE_SEEKER:
428                                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM);
429                                 self.mins = '-4 -4 -4';
430                                 self.maxs = '4 4 4';
431                                 break;
432             case PROJECTILE_RAPTORBOMB:
433                                 self.mins = '-3 -3 -3';
434                                 self.maxs = '3 3 3';
435                                 break;
436             case PROJECTILE_RAPTORBOMBLET:
437                                 break;
438             case PROJECTILE_RAPTORCANNON:
439                                 break;
440             case PROJECTILE_SPIDERROCKET:
441                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM);
442                                 break;
443             case PROJECTILE_WAKIROCKET:
444                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM);
445                                 break;
446             /*
447             case PROJECTILE_WAKICANNON:
448                                 break;
449                         case PROJECTILE_BUMBLE_GUN:
450                                 // only new engines support sound moving with object
451                                 loopsound(self, CH_SHOTS_SINGLE, W_Sound("electro_fly"), VOL_BASE, ATTEN_NORM);
452                                 self.mins = '0 0 -4';
453                                 self.maxs = '0 0 -4';
454                                 self.move_movetype = MOVETYPE_BOUNCE;
455                                 self.move_touch = func_null;
456                                 self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
457                                 self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
458                                 break;
459                         */
460                         default:
461                                 break;
462                 }
463
464                 if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
465                 {
466                         entity nade_type = Nade_FromProjectile(self.cnt);
467                         self.mins = '-16 -16 -16';
468                         self.maxs = '16 16 16';
469                         self.colormod = nade_type.m_color;
470                         self.move_movetype = MOVETYPE_BOUNCE;
471                         self.move_touch = func_null;
472                         self.scale = 1.5;
473                         self.avelocity = randomvec() * 720;
474
475                         if(nade_type == NADE_TYPE_TRANSLOCATE || nade_type == NADE_TYPE_SPAWN)
476                                 self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
477                         else
478                                 self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
479                 }
480
481                 MUTATOR_CALLHOOK(EditProjectile, self);
482
483                 setsize(self, self.mins, self.maxs);
484         }
485
486         if(self.gravity)
487         {
488                 if(self.move_movetype == MOVETYPE_FLY)
489                         self.move_movetype = MOVETYPE_TOSS;
490                 if(self.move_movetype == MOVETYPE_BOUNCEMISSILE)
491                         self.move_movetype = MOVETYPE_BOUNCE;
492         }
493         else
494         {
495                 if(self.move_movetype == MOVETYPE_TOSS)
496                         self.move_movetype = MOVETYPE_FLY;
497                 if(self.move_movetype == MOVETYPE_BOUNCE)
498                         self.move_movetype = MOVETYPE_BOUNCEMISSILE;
499         }
500
501         if(!(self.count & 0x80))
502                 InterpolateOrigin_Note();
503
504         self.classname = "csqcprojectile";
505         self.draw = Projectile_Draw;
506         self.entremove = Ent_RemoveProjectile;
507 }
508
509 void Projectile_Precache()
510 {
511         precache_model("models/ebomb.mdl");
512         precache_model("models/elaser.mdl");
513         precache_model("models/grenademodel.md3");
514         precache_model("models/mine.md3");
515         precache_model("models/hagarmissile.mdl");
516         precache_model("models/hlac_bullet.md3");
517         precache_model("models/laser.mdl");
518         precache_model("models/plasmatrail.mdl");
519         precache_model("models/rocket.md3");
520         precache_model("models/tagrocket.md3");
521         precache_model("models/tracer.mdl");
522         precache_model("models/sphere/sphere.md3");
523
524         precache_model(W_Model("v_ok_grenade.md3"));
525         precache_model(W_Model("ok_rocket.md3"));
526
527         precache_sound(W_Sound("electro_fly"));
528         precache_sound(W_Sound("rocket_fly"));
529         precache_sound(W_Sound("fireball_fly"));
530         precache_sound(W_Sound("fireball_fly2"));
531         precache_sound(W_Sound("tag_rocket_fly"));
532
533         MUTATOR_CALLHOOK(PrecacheProjectiles);
534 }