]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/w_laser.qc
Implement new primary effect for Blaster-- MESSY MESSY MESSY!
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_laser.qc
1 #ifdef REGISTER_WEAPON
2 REGISTER_WEAPON(LASER, W_Laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "laser", "laser", _("Blaster"))
3 #else
4 #ifdef SVQC
5 void(float imp) W_SwitchWeapon;
6 void() W_LastWeapon;
7 .float swing_prev;
8 .entity swing_alreadyhit;
9
10 void SendCSQCShockwaveParticle(vector endpos, entity transform) 
11 {
12         endpos = WarpZone_UnTransformOrigin(transform, endpos);
13         
14         WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
15         WriteByte(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
16         WriteCoord(MSG_BROADCAST, w_shotorg_x);
17         WriteCoord(MSG_BROADCAST, w_shotorg_y);
18         WriteCoord(MSG_BROADCAST, w_shotorg_z);
19         WriteCoord(MSG_BROADCAST, endpos_x);
20         WriteCoord(MSG_BROADCAST, endpos_y);
21         WriteCoord(MSG_BROADCAST, endpos_z);
22         WriteByte(MSG_BROADCAST, bound(0, autocvar_g_balance_laser_primary_spread_max, 255));
23         WriteByte(MSG_BROADCAST, bound(0, autocvar_g_balance_laser_primary_spread_min, 255));
24         
25         //makevectors(w_shotdir);
26         //WriteByte(MSG_BROADCAST, bound(0, 255 * vlen(normalize((endpos + (v_up * autocvar_g_balance_laser_primary_spread_max)) - w_shotorg) - w_shotdir), 255));
27 }
28
29 void W_Laser_Touch()
30 {
31         PROJECTILE_TOUCH;
32
33         self.event_damage = SUB_Null;
34         
35         if(self.dmg)
36                 RadiusDamage(self, self.realowner, autocvar_g_balance_laser_secondary_damage, autocvar_g_balance_laser_secondary_edgedamage, autocvar_g_balance_laser_secondary_radius, world, world, autocvar_g_balance_laser_secondary_force, self.projectiledeathtype, other);
37         else
38                 RadiusDamage(self, self.realowner, autocvar_g_balance_laser_primary_damage, autocvar_g_balance_laser_primary_edgedamage, autocvar_g_balance_laser_primary_radius, world, world, autocvar_g_balance_laser_primary_force, self.projectiledeathtype, other);
39
40         remove(self);
41 }
42
43 void W_Laser_Think()
44 {
45         self.movetype = MOVETYPE_FLY;
46         self.think = SUB_Remove;
47         
48         if(self.dmg)
49                 self.nextthink = time + autocvar_g_balance_laser_secondary_lifetime;
50         else
51                 self.nextthink = time + autocvar_g_balance_laser_primary_lifetime;
52                 
53         CSQCProjectile(self, TRUE, PROJECTILE_LASER, TRUE);
54 }
55
56
57 float W_Laser_Shockwave_CheckSpread(vector targetorg, vector nearest_on_line, vector sw_shotorg, vector attack_endpos)
58 {
59         float spreadlimit;
60         float distance_of_attack = vlen(sw_shotorg - attack_endpos);
61         float distance_from_line = vlen(targetorg - nearest_on_line);
62
63         float total_angle = (vlen(normalize(targetorg - sw_shotorg) - normalize(attack_endpos - sw_shotorg)) * RAD2DEG); 
64         
65         spreadlimit = (distance_of_attack ? min(1, (vlen(sw_shotorg - nearest_on_line) / distance_of_attack)) : 1);
66         spreadlimit = (autocvar_g_balance_laser_primary_spread_min * (1 - spreadlimit) + autocvar_g_balance_laser_primary_spread_max * spreadlimit);
67         
68         if(spreadlimit && (distance_from_line <= spreadlimit) && (total_angle <= 90))
69                 return bound(0, (distance_from_line / spreadlimit), 1);
70         else
71                 return FALSE;
72 }
73
74 float W_Laser_Shockwave_IsVisible(entity head, vector nearest_on_line, vector sw_shotorg, vector attack_endpos)
75 {
76         vector nearest_to_attacker = head.WarpZone_findradius_nearest;
77         vector center = (head.origin + (head.mins + head.maxs) * 0.5);
78         vector corner;
79         float i;
80
81         // STEP ONE: Check if the nearest point is clear
82         if(W_Laser_Shockwave_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
83         {
84                 WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, self);
85                 if(trace_fraction == 1) { return TRUE; } // yes, the nearest point is clear and we can allow the damage
86         }
87
88         // STEP TWO: Check if shotorg to center point is clear
89         if(W_Laser_Shockwave_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
90         {
91                 WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, self);
92                 if(trace_fraction == 1) { return TRUE; } // yes, the center point is clear and we can allow the damage
93         }
94
95         // STEP THREE: Check each corner to see if they are clear
96         for(i=1; i<=8; ++i)
97         {
98                 corner = get_corner_position(head, i);
99                 if(W_Laser_Shockwave_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
100                 {
101                         WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, self);
102                         if(trace_fraction == 1) { return TRUE; } // yes, this corner is clear and we can allow the damage
103                 }
104         }
105
106         return FALSE;
107 }
108
109 void W_Laser_Shockwave()
110 {
111         // declarations
112         float multiplier, multiplier_from_accuracy, multiplier_from_distance;
113         float final_damage, final_spread;
114         vector final_force, center;
115         entity head, next;
116         
117         // set up the shot direction
118         vector wanted_shot_direction = (v_forward * cos(autocvar_g_balance_laser_primary_shotangle * DEG2RAD) + v_up * sin(autocvar_g_balance_laser_primary_shotangle * DEG2RAD));
119         W_SetupShot_Dir(self, wanted_shot_direction, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, autocvar_g_balance_laser_primary_damage);
120         vector attack_endpos = (w_shotorg + (w_shotdir * autocvar_g_balance_laser_primary_radius));
121
122         // find out what we're pointing at and acquire the warpzone transform
123         WarpZone_TraceLine(w_shotorg, attack_endpos, FALSE, self);
124         entity aim_ent = trace_ent;
125         entity transform = WarpZone_trace_transform;
126         
127         vector attack_hitpos = trace_endpos;
128         float distance_to_hit = vlen(w_shotorg - attack_hitpos);
129         float distance_to_end = vlen(w_shotorg - attack_endpos);
130         
131         // do the jump explosion now (also handles the impact effect)
132         RadiusDamageForSource(self, trace_endpos, '0 0 0', self, autocvar_g_balance_laser_primary_damage, autocvar_g_balance_laser_primary_edgedamage, autocvar_g_balance_laser_primary_jumpradius, world, self, TRUE, autocvar_g_balance_laser_primary_force, WEP_LASER, world);
133         
134         // also do the firing effect now
135         SendCSQCShockwaveParticle(attack_endpos, transform);
136         
137         // did we hit a player directly?
138         if(aim_ent.takedamage)
139         {
140                 // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
141                 center = (aim_ent.origin + ((aim_ent.classname == "player") ? aim_ent.view_ofs : ((aim_ent.mins + aim_ent.maxs) * 0.5)));
142                 
143                 multiplier_from_accuracy = 1;
144                 multiplier_from_distance = (1 - (distance_to_hit ? min(1, (distance_to_hit / distance_to_end)) : 0));
145                 multiplier = max(autocvar_g_balance_laser_primary_multiplier_min, ((multiplier_from_accuracy * autocvar_g_balance_laser_primary_multiplier_accuracy) + (multiplier_from_distance * autocvar_g_balance_laser_primary_multiplier_distance)));
146                 
147                 final_force = ((normalize(center - attack_hitpos) * autocvar_g_balance_laser_primary_force) * multiplier);
148                 final_damage = (autocvar_g_balance_laser_primary_damage * multiplier + autocvar_g_balance_laser_primary_edgedamage * (1 - multiplier));
149                 Damage(aim_ent, self, self, final_damage, WEP_LASER, aim_ent.origin, final_force);
150                 
151                 print("debug: DIRECT HIT: multiplier = ", ftos(multiplier), strcat(", damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force))),"... multiplier_from_accuracy = ", ftos(multiplier_from_accuracy), ", multiplier_from_distance = ", ftos(multiplier_from_distance), ".\n");
152         }
153
154         // now figure out if I hit anything else than what my aim directly pointed at...
155         head = WarpZone_FindRadius(w_shotorg, autocvar_g_balance_laser_primary_radius, FALSE);
156         while(head)
157         {
158                 next = head.chain;
159                 
160                 if((head != self && head != aim_ent) && (head.takedamage))
161                 {
162                         // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc) 
163                         center = (head.origin + ((head.classname == "player") ? head.view_ofs : ((head.mins + head.maxs) * 0.5)));
164
165                         // find the closest point on the enemy to the center of the attack
166                         float ang; // angle between shotdir and h
167                         float h; // hypotenuse, which is the distance between attacker to head
168                         float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
169                         
170                         h = vlen(center - self.origin);
171                         ang = acos(dotproduct(normalize(center - self.origin), w_shotdir));
172                         a = h * cos(ang);
173
174                         vector nearest_on_line = (w_shotorg + a * w_shotdir);
175                         vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
176                         float distance_to_target = vlen(w_shotorg - nearest_to_attacker);
177
178                         if((distance_to_target <= autocvar_g_balance_laser_primary_radius) 
179                                 && (W_Laser_Shockwave_IsVisible(head, nearest_on_line, w_shotorg, attack_endpos)))
180                         {
181                                 multiplier_from_accuracy = (1 - W_Laser_Shockwave_CheckSpread(nearest_to_attacker, nearest_on_line, w_shotorg, attack_endpos));
182                                 multiplier_from_distance = (1 - (distance_to_hit ? min(1, (distance_to_target / distance_to_end)) : 0));
183                                 multiplier = max(autocvar_g_balance_laser_primary_multiplier_min, ((multiplier_from_accuracy * autocvar_g_balance_laser_primary_multiplier_accuracy) + (multiplier_from_distance * autocvar_g_balance_laser_primary_multiplier_distance)));
184
185                                 final_force = ((normalize(center - nearest_on_line) * autocvar_g_balance_laser_primary_force) * multiplier);
186                                 final_damage = (autocvar_g_balance_laser_primary_damage * multiplier + autocvar_g_balance_laser_primary_edgedamage * (1 - multiplier));
187                                 Damage(head, self, self, final_damage, WEP_LASER, head.origin, final_force);
188
189                                 print("debug: EDGE HIT: multiplier = ", ftos(multiplier), strcat(", damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force))),"... multiplier_from_accuracy = ", ftos(multiplier_from_accuracy), ", multiplier_from_distance = ", ftos(multiplier_from_distance), ".\n");
190                         }
191                 }
192                 head = next;
193         }
194 }
195
196 void W_Laser_Melee_Think()
197 {
198         // declarations
199         float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
200         entity target_victim;
201         vector targpos;
202
203         if(!self.cnt) // set start time of melee
204         {
205                 self.cnt = time; 
206                 W_PlayStrengthSound(self.realowner);
207         }
208
209         makevectors(self.realowner.v_angle); // update values for v_* vectors
210         
211         // calculate swing percentage based on time
212         meleetime = autocvar_g_balance_laser_secondary_melee_time * W_WeaponRateFactor();
213         swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
214         f = ((1 - swing) * autocvar_g_balance_laser_secondary_melee_traces);
215         
216         // check to see if we can still continue, otherwise give up now
217         if((self.realowner.deadflag != DEAD_NO) && autocvar_g_balance_laser_secondary_melee_no_doubleslap)
218         {
219                 remove(self);
220                 return;
221         }
222         
223         // if okay, perform the traces needed for this frame 
224         for(i=self.swing_prev; i < f; ++i)
225         {
226                 swing_factor = ((1 - (i / autocvar_g_balance_laser_secondary_melee_traces)) * 2 - 1);
227                 
228                 targpos = (self.realowner.origin + self.realowner.view_ofs 
229                         + (v_forward * autocvar_g_balance_laser_secondary_melee_range)
230                         + (v_up * swing_factor * autocvar_g_balance_laser_secondary_melee_swing_up)
231                         + (v_right * swing_factor * autocvar_g_balance_laser_secondary_melee_swing_side));
232
233                 WarpZone_traceline_antilag(self.realowner, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self.realowner, ANTILAG_LATENCY(self.realowner));
234                 
235                 // draw lightning beams for debugging
236                 te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5); 
237                 te_customflash(targpos, 40,  2, '1 1 1');
238                 
239                 is_player = (trace_ent.classname == "player" || trace_ent.classname == "body");
240
241                 if((trace_fraction < 1) // if trace is good, apply the damage and remove self
242                         && (trace_ent.takedamage == DAMAGE_AIM)  
243                         && (trace_ent != self.swing_alreadyhit)
244                         && (is_player || autocvar_g_balance_laser_secondary_melee_nonplayerdamage))
245                 {
246                         target_victim = trace_ent; // so it persists through other calls
247                         
248                         if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught.
249                                 swing_damage = (autocvar_g_balance_laser_secondary_damage * min(1, swing_factor + 1));
250                         else
251                                 swing_damage = (autocvar_g_balance_laser_secondary_melee_nonplayerdamage * min(1, swing_factor + 1));
252                         
253                         //print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n"));
254                         
255                         Damage(target_victim, self.realowner, self.realowner, 
256                                 swing_damage, WEP_LASER | HITTYPE_SECONDARY, 
257                                 self.realowner.origin + self.realowner.view_ofs, 
258                                 v_forward * autocvar_g_balance_laser_secondary_force);
259                                 
260                         if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_LASER, 0, swing_damage); }
261                         
262                         if(autocvar_g_balance_laser_secondary_melee_multihit) // allow multiple hits with one swing, but not against the same player twice.
263                         {
264                                 self.swing_alreadyhit = target_victim;
265                                 continue; // move along to next trace
266                         }
267                         else
268                         {
269                                 remove(self);
270                                 return;
271                         }
272                 }
273         }
274         
275         if(time >= self.cnt + meleetime)
276         {
277                 // melee is finished
278                 remove(self);
279                 return;
280         }
281         else
282         {
283                 // set up next frame 
284                 self.swing_prev = i;
285                 self.nextthink = time;
286         }
287 }
288
289 void W_Laser_Melee()
290 {
291         sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
292         weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_laser_secondary_animtime, w_ready);
293
294         entity meleetemp;
295         meleetemp = spawn();
296         meleetemp.owner = meleetemp.realowner = self;
297         meleetemp.think = W_Laser_Melee_Think;
298         meleetemp.nextthink = time + autocvar_g_balance_laser_secondary_melee_delay * W_WeaponRateFactor();
299         W_SetupShot_Range(self, TRUE, 0, "", 0, autocvar_g_balance_laser_secondary_damage, autocvar_g_balance_laser_secondary_melee_range);
300 }
301
302 void W_Laser_Attack(float issecondary)
303 {
304         entity missile;
305         vector s_forward;
306         float a;
307         float nodamage;
308
309         if(issecondary == 2) // minstanex shot
310                 nodamage = g_minstagib;
311         else
312                 nodamage = FALSE;
313
314         a = autocvar_g_balance_laser_primary_shotangle;
315         s_forward = v_forward * cos(a * DEG2RAD) + v_up * sin(a * DEG2RAD);
316
317         if(nodamage)
318                 W_SetupShot_Dir(self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, 0);
319         else if(issecondary == 1)
320                 W_SetupShot_Dir(self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, autocvar_g_balance_laser_secondary_damage);
321         else
322                 W_SetupShot_Dir(self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, autocvar_g_balance_laser_primary_damage);
323         pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
324
325         missile = spawn();
326         missile.owner = missile.realowner = self;
327         missile.classname = "laserbolt";
328         missile.dmg = 0;
329         if(!nodamage)
330         {
331                 missile.bot_dodge = TRUE;
332                 missile.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
333         }
334
335         PROJECTILE_MAKETRIGGER(missile);
336         missile.projectiledeathtype = WEP_LASER;
337
338         setorigin(missile, w_shotorg);
339         setsize(missile, '0 0 0', '0 0 0');
340
341         W_SETUPPROJECTILEVELOCITY(missile, g_balance_laser_primary);
342         missile.angles = vectoangles(missile.velocity);
343         //missile.glow_color = 250; // 244, 250
344         //missile.glow_size = 120;
345         missile.touch = W_Laser_Touch;
346
347         missile.flags = FL_PROJECTILE;
348         missile.missile_flags = MIF_SPLASH; 
349
350         missile.think = W_Laser_Think;
351         missile.nextthink = time + autocvar_g_balance_laser_primary_delay;
352
353         other = missile; MUTATOR_CALLHOOK(EditProjectile);
354
355         if(time >= missile.nextthink)
356         {
357                 entity oldself;
358                 oldself = self;
359                 self = missile;
360                 self.think();
361                 self = oldself;
362         }
363 }
364
365 void spawnfunc_weapon_laser(void)
366 {
367         weapon_defaultspawnfunc(WEP_LASER);
368 }
369
370 float W_Laser(float request)
371 {
372         switch(request)
373         {
374                 case WR_AIM:
375                 {
376                         if((autocvar_g_balance_laser_secondary == 2) && (vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_laser_secondary_melee_range))
377                                 self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
378                         else
379                                 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
380                         return TRUE;
381                 }
382                 
383                 case WR_THINK:
384                 {
385                         if(autocvar_g_balance_laser_reload_ammo && self.clip_load < 1) // forced reload
386                                 weapon_action(self.weapon, WR_RELOAD);
387                         else if(self.BUTTON_ATCK)
388                         {
389                                 if(weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire))
390                                 {
391                                         W_DecreaseAmmo(ammo_none, 1, TRUE);
392
393
394                                         if not(autocvar_g_balance_laser_oldprimary)
395                                                 W_Laser_Shockwave();
396                                         else
397                                                 W_Laser_Attack(FALSE);
398
399                                         weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_laser_primary_animtime, w_ready);
400                                 }
401                         }
402                         else if(self.BUTTON_ATCK2)
403                         {
404                                 switch(autocvar_g_balance_laser_secondary)
405                                 {
406                                         case 0: // switch to last used weapon
407                                         {
408                                                 if(self.switchweapon == WEP_LASER) // don't do this if already switching
409                                                         W_LastWeapon();
410
411                                                 break;
412                                         }
413
414                                         case 1: // normal projectile secondary
415                                         {
416                                                 if(weapon_prepareattack(1, autocvar_g_balance_laser_secondary_refire))
417                                                 {
418                                                         W_DecreaseAmmo(ammo_none, 1, TRUE);
419                                                         W_Laser_Attack(TRUE);
420                                                         weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_laser_secondary_animtime, w_ready);
421                                                 }
422
423                                                 break;
424                                         }
425
426                                         case 2: // melee attack secondary
427                                         {
428                                                 if(!self.crouch) // we are not currently crouching; this fixes an exploit where your melee anim is not visible, and besides wouldn't make much sense
429                                                 if(weapon_prepareattack(1, autocvar_g_balance_laser_secondary_refire))
430                                                 {
431                                                         // attempt forcing playback of the anim by switching to another anim (that we never play) here...
432                                                         W_Laser_Melee();
433                                                         weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_laser_secondary_animtime, w_ready);
434                                                 }
435                                         }
436                                 }
437                         }
438                         return TRUE;
439                 }
440                 
441                 case WR_PRECACHE: 
442                 {
443                         precache_model("models/weapons/g_laser.md3");
444                         precache_model("models/weapons/v_laser.md3");
445                         precache_model("models/weapons/h_laser.iqm");
446                         precache_sound("weapons/lasergun_fire.wav");
447                         return TRUE;
448                 }
449                 
450                 case WR_SETUP:
451                 {
452                         weapon_setup(WEP_LASER);
453                         self.current_ammo = ammo_none;
454                         return TRUE;
455                 }
456                 
457                 case WR_CHECKAMMO1:
458                 case WR_CHECKAMMO2:
459                 {
460                         return TRUE; // laser has infinite ammo
461                 }
462                 
463                 case WR_RELOAD:
464                 {
465                         W_Reload(0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
466                         return TRUE;
467                 }
468         }
469         
470         return TRUE;
471 }
472 #endif
473 #ifdef CSQC
474 float W_Laser(float request)
475 {
476         switch(request)
477         {
478                 case WR_IMPACTEFFECT:
479                 {
480                         vector org2;
481                         org2 = w_org + w_backoff * 6;
482                         pointparticles(particleeffectnum("new_laser_impact"), org2, w_backoff * 1000, 1);
483                         if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); }
484                         return TRUE;
485                 }
486                 
487                 case WR_PRECACHE:
488                 {
489                         precache_sound("weapons/laserimpact.wav");
490                         return TRUE;
491                 }
492                 case WR_SUICIDEMESSAGE:
493                 {
494                         w_deathtypestring = _("%s lasered themself to hell");
495                         return TRUE;
496                 }
497                 case WR_KILLMESSAGE:
498                 {
499                         if(w_deathtype & HITTYPE_SECONDARY)
500                                 w_deathtypestring = _("%s was cut in half by %s's gauntlet"); // unchecked: SPLASH // TODO 
501                         else
502                                 w_deathtypestring = _("%s was lasered to death by %s"); // unchecked: SPLASH
503                         return TRUE;
504                 }
505         }
506         
507         return TRUE;
508 }
509 #endif
510 #endif