Merge branch 'master' into terencehill/music_player
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_mortar.qc
1 #ifdef REGISTER_WEAPON
2 REGISTER_WEAPON(
3 /* WEP_##id  */ MORTAR,
4 /* function  */ W_Mortar,
5 /* ammotype  */ ammo_rockets,
6 /* impulse   */ 4,
7 /* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
8 /* rating    */ BOT_PICKUP_RATING_MID,
9 /* color     */ '1 0 0',
10 /* modelname */ "gl",
11 /* simplemdl */ "foobar",
12 /* crosshair */ "gfx/crosshairgrenadelauncher 0.7",
13 /* wepimg    */ "weapongrenadelauncher",
14 /* refname   */ "mortar",
15 /* wepname   */ _("Mortar")
16 );
17
18 #define MORTAR_SETTINGS(w_cvar,w_prop) MORTAR_SETTINGS_LIST(w_cvar, w_prop, MORTAR, mortar)
19 #define MORTAR_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
20         w_cvar(id, sn, BOTH, ammo) \
21         w_cvar(id, sn, BOTH, animtime) \
22         w_cvar(id, sn, NONE, bouncefactor) \
23         w_cvar(id, sn, NONE, bouncestop) \
24         w_cvar(id, sn, BOTH, damage) \
25         w_cvar(id, sn, BOTH, damageforcescale) \
26         w_cvar(id, sn, BOTH, edgedamage) \
27         w_cvar(id, sn, BOTH, force) \
28         w_cvar(id, sn, BOTH, health) \
29         w_cvar(id, sn, BOTH, lifetime) \
30         w_cvar(id, sn, SEC,  lifetime_bounce) \
31         w_cvar(id, sn, BOTH, lifetime_stick) \
32         w_cvar(id, sn, BOTH, radius) \
33         w_cvar(id, sn, BOTH, refire) \
34         w_cvar(id, sn, SEC,  remote_detonateprimary) \
35         w_cvar(id, sn, PRI,  remote_minbouncecnt) \
36         w_cvar(id, sn, BOTH, speed) \
37         w_cvar(id, sn, BOTH, speed_up) \
38         w_cvar(id, sn, BOTH, speed_z) \
39         w_cvar(id, sn, BOTH, spread) \
40         w_cvar(id, sn, BOTH, type) \
41         w_prop(id, sn, float,  reloading_ammo, reload_ammo) \
42         w_prop(id, sn, float,  reloading_time, reload_time) \
43         w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
44         w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
45         w_prop(id, sn, string, weaponreplace, weaponreplace) \
46         w_prop(id, sn, float,  weaponstart, weaponstart) \
47         w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride) \
48         w_prop(id, sn, float,  weaponthrowable, weaponthrowable)
49
50 #ifdef SVQC
51 MORTAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
52 .float gl_detonate_later;
53 .float gl_bouncecnt;
54 #endif
55 #else
56 #ifdef SVQC
57
58 void spawnfunc_weapon_mortar(void) { weapon_defaultspawnfunc(WEP_MORTAR); }
59 void spawnfunc_weapon_grenadelauncher(void) { spawnfunc_weapon_mortar(); }
60
61 void W_Mortar_Grenade_Explode(void)
62 {
63         if(other.takedamage == DAMAGE_AIM)
64                 if(IS_PLAYER(other))
65                         if(DIFF_TEAM(self.realowner, other))
66                                 if(other.deadflag == DEAD_NO)
67                                         if(IsFlying(other))
68                                                 Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
69
70         self.event_damage = func_null;
71         self.takedamage = DAMAGE_NO;
72
73         if(self.movetype == MOVETYPE_NONE)
74                 self.velocity = self.oldvelocity;
75
76         RadiusDamage(self, self.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), self.projectiledeathtype, other);
77
78         remove(self);
79 }
80
81 void W_Mortar_Grenade_Explode2(void)
82 {
83         if(other.takedamage == DAMAGE_AIM)
84                 if(IS_PLAYER(other))
85                         if(DIFF_TEAM(self.realowner, other))
86                                 if(other.deadflag == DEAD_NO)
87                                         if(IsFlying(other))
88                                                 Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
89
90         self.event_damage = func_null;
91         self.takedamage = DAMAGE_NO;
92
93         if(self.movetype == MOVETYPE_NONE)
94                 self.velocity = self.oldvelocity;
95
96         RadiusDamage(self, self.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), self.projectiledeathtype, other);
97
98         remove(self);
99 }
100
101
102 void W_Mortar_Grenade_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
103 {
104         if(self.health <= 0)
105                 return;
106                 
107         if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
108                 return; // g_projectiles_damage says to halt
109                 
110         self.health = self.health - damage;
111         
112         if(self.health <= 0)
113                 W_PrepareExplosionByDamage(attacker, self.use);
114 }
115
116 void W_Mortar_Grenade_Think1(void)
117 {
118         self.nextthink = time;
119         if(time > self.cnt)
120         {
121                 other = world;
122                 self.projectiledeathtype |= HITTYPE_BOUNCE;
123                 W_Mortar_Grenade_Explode();
124                 return;
125         }
126         if(self.gl_detonate_later && self.gl_bouncecnt >= WEP_CVAR_PRI(mortar, remote_minbouncecnt))
127                 W_Mortar_Grenade_Explode();
128 }
129
130 void W_Mortar_Grenade_Touch1(void)
131 {
132         PROJECTILE_TOUCH;
133         if(other.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
134         {
135                 self.use();
136         }
137         else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
138         {
139                 float r;
140                 r = random() * 6;
141                 if(r < 1)
142                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
143                 else if(r < 2)
144                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
145                 else if(r < 3)
146                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
147                 else if(r < 4)
148                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
149                 else if(r < 5)
150                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
151                 else
152                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
153                 pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
154                 self.projectiledeathtype |= HITTYPE_BOUNCE;
155                 self.gl_bouncecnt += 1;
156         }
157         else if(WEP_CVAR_PRI(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
158         {
159                 spamsound(self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
160
161                 // let it stick whereever it is
162                 self.oldvelocity = self.velocity;
163                 self.velocity = '0 0 0';
164                 self.movetype = MOVETYPE_NONE; // also disables gravity
165                 self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
166                 UpdateCSQCProjectile(self);
167
168                 // do not respond to any more touches
169                 self.solid = SOLID_NOT;
170
171                 self.nextthink = min(self.nextthink, time + WEP_CVAR_PRI(mortar, lifetime_stick));
172         }
173 }
174
175 void W_Mortar_Grenade_Touch2(void)
176 {
177         PROJECTILE_TOUCH;
178         if(other.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
179         {
180                 self.use();
181         }
182         else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
183         {
184                 float r;
185                 r = random() * 6;
186                 if(r < 1)
187                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
188                 else if(r < 2)
189                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
190                 else if(r < 3)
191                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
192                 else if(r < 4)
193                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
194                 else if(r < 5)
195                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
196                 else
197                         spamsound(self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
198                 pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
199                 self.projectiledeathtype |= HITTYPE_BOUNCE;
200                 self.gl_bouncecnt += 1;
201                 
202                 if(WEP_CVAR_SEC(mortar, lifetime_bounce) && self.gl_bouncecnt == 1)
203                         self.nextthink = time + WEP_CVAR_SEC(mortar, lifetime_bounce);
204                         
205         }
206         else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
207         {
208                 spamsound(self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
209
210                 // let it stick whereever it is
211                 self.oldvelocity = self.velocity;
212                 self.velocity = '0 0 0';
213                 self.movetype = MOVETYPE_NONE; // also disables gravity
214                 self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
215                 UpdateCSQCProjectile(self);
216
217                 // do not respond to any more touches
218                 self.solid = SOLID_NOT;
219
220                 self.nextthink = min(self.nextthink, time + WEP_CVAR_SEC(mortar, lifetime_stick));
221         }
222 }
223
224 void W_Mortar_Attack(void)
225 {
226         entity gren;
227
228         W_DecreaseAmmo(WEP_CVAR_PRI(mortar, ammo));
229
230         W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
231         w_shotdir = v_forward; // no TrueAim for grenades please
232
233         pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
234
235         gren = spawn();
236         gren.owner = gren.realowner = self;
237         gren.classname = "grenade";
238         gren.bot_dodge = TRUE;
239         gren.bot_dodgerating = WEP_CVAR_PRI(mortar, damage);
240         gren.movetype = MOVETYPE_BOUNCE;
241         gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
242         gren.bouncestop = WEP_CVAR(mortar, bouncestop);
243         PROJECTILE_MAKETRIGGER(gren);
244         gren.projectiledeathtype = WEP_MORTAR;
245         setorigin(gren, w_shotorg);
246         setsize(gren, '-3 -3 -3', '3 3 3');
247
248         gren.cnt = time + WEP_CVAR_PRI(mortar, lifetime);
249         gren.nextthink = time;
250         gren.think = W_Mortar_Grenade_Think1;
251         gren.use = W_Mortar_Grenade_Explode;
252         gren.touch = W_Mortar_Grenade_Touch1;
253
254         gren.takedamage = DAMAGE_YES;
255         gren.health = WEP_CVAR_PRI(mortar, health);
256         gren.damageforcescale = WEP_CVAR_PRI(mortar, damageforcescale);
257         gren.event_damage = W_Mortar_Grenade_Damage;
258         gren.damagedbycontents = TRUE;
259         gren.missile_flags = MIF_SPLASH | MIF_ARC;
260         W_SetupProjVelocity_UP_PRI(gren, mortar);
261
262         gren.angles = vectoangles(gren.velocity);
263         gren.flags = FL_PROJECTILE;
264
265         if(WEP_CVAR_PRI(mortar, type) == 0 || WEP_CVAR_PRI(mortar, type) == 2)
266                 CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
267         else
268                 CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
269
270         other = gren; MUTATOR_CALLHOOK(EditProjectile);
271 }
272
273 void W_Mortar_Attack2(void)
274 {
275         entity gren;
276
277         W_DecreaseAmmo(WEP_CVAR_SEC(mortar, ammo));
278
279         W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
280         w_shotdir = v_forward; // no TrueAim for grenades please
281
282         pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
283
284         gren = spawn();
285         gren.owner = gren.realowner = self;
286         gren.classname = "grenade";
287         gren.bot_dodge = TRUE;
288         gren.bot_dodgerating = WEP_CVAR_SEC(mortar, damage);
289         gren.movetype = MOVETYPE_BOUNCE;
290         gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
291         gren.bouncestop = WEP_CVAR(mortar, bouncestop);
292         PROJECTILE_MAKETRIGGER(gren);
293         gren.projectiledeathtype = WEP_MORTAR | HITTYPE_SECONDARY;
294         setorigin(gren, w_shotorg);
295         setsize(gren, '-3 -3 -3', '3 3 3');
296
297         gren.nextthink = time + WEP_CVAR_SEC(mortar, lifetime);
298         gren.think = adaptor_think2use_hittype_splash;
299         gren.use = W_Mortar_Grenade_Explode2;
300         gren.touch = W_Mortar_Grenade_Touch2;
301
302         gren.takedamage = DAMAGE_YES;
303         gren.health = WEP_CVAR_SEC(mortar, health);
304         gren.damageforcescale = WEP_CVAR_SEC(mortar, damageforcescale);
305         gren.event_damage = W_Mortar_Grenade_Damage;
306         gren.damagedbycontents = TRUE;
307         gren.missile_flags = MIF_SPLASH | MIF_ARC;
308         W_SetupProjVelocity_UP_SEC(gren, mortar);
309
310         gren.angles = vectoangles(gren.velocity);
311         gren.flags = FL_PROJECTILE;
312
313         if(WEP_CVAR_SEC(mortar, type) == 0 || WEP_CVAR_SEC(mortar, type) == 2)
314                 CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
315         else
316                 CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
317
318         other = gren; MUTATOR_CALLHOOK(EditProjectile);
319 }
320
321 .float bot_secondary_grenademooth;
322 float W_Mortar(float req)
323 {
324         entity nade;
325         float nadefound;
326         float ammo_amount;
327         switch(req)
328         {
329                 case WR_AIM:
330                 {
331                         self.BUTTON_ATCK = FALSE;
332                         self.BUTTON_ATCK2 = FALSE;
333                         if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
334                         {
335                                 if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), TRUE))
336                                 {
337                                         self.BUTTON_ATCK = TRUE;
338                                         if(random() < 0.01) self.bot_secondary_grenademooth = 1;
339                                 }
340                         }
341                         else
342                         {
343                                 if(bot_aim(WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), TRUE))
344                                 {
345                                         self.BUTTON_ATCK2 = TRUE;
346                                         if(random() < 0.02) self.bot_secondary_grenademooth = 0;
347                                 }
348                         }
349                         
350                         return TRUE;
351                 }
352                 /*case WR_CALCINFO:
353                 {
354                         wepinfo_pri_refire = max3(sys_frametime, WEP_CVAR_PRI(mortar, refire), WEP_CVAR_PRI(mortar, animtime));
355                         wepinfo_pri_dps = (WEP_CVAR_PRI(mortar, damage) * (1 / wepinfo_pri_refire));
356                         wepinfo_pri_speed = (1 / max(1, (10000 / max(1, WEP_CVAR_PRI(mortar, speed)))));
357
358                         // for the range calculation, closer to 1 is better
359                         wepinfo_pri_range_max = 2000 * wepinfo_pri_speed;
360                         wepinfo_pri_range = wepinfo_pri_speed * WEP_CVAR_PRI(mortar, 
361                         
362                         wepinfo_sec_refire = max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime));
363                         wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / wepinfo_sec_refire));
364                         
365                         wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime))));
366                         wepinfo_ter_dps = 0;
367                         */
368                 case WR_THINK:
369                 {
370                         if(autocvar_g_balance_mortar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) // forced reload
371                                 WEP_ACTION(self.weapon, WR_RELOAD);
372                         else if(self.BUTTON_ATCK)
373                         {
374                                 if(weapon_prepareattack(0, WEP_CVAR_PRI(mortar, refire)))
375                                 {
376                                         W_Mortar_Attack();
377                                         weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
378                                 }
379                         }
380                         else if(self.BUTTON_ATCK2)
381                         {
382                                 if(WEP_CVAR_SEC(mortar, remote_detonateprimary))
383                                 {
384                                         nadefound = 0;
385                                         for(nade = world; (nade = find(nade, classname, "grenade")); ) if(nade.realowner == self)
386                                         {
387                                                 if(!nade.gl_detonate_later)
388                                                 {
389                                                         nade.gl_detonate_later = TRUE;
390                                                         nadefound = 1;
391                                                 }
392                                         }
393                                         if(nadefound)
394                                                 sound(self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
395                                 }
396                                 else if(weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire)))
397                                 {
398                                         W_Mortar_Attack2();
399                                         weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
400                                 }
401                         }
402                         
403                         return TRUE;
404                 }
405                 case WR_INIT:
406                 {
407                         precache_model("models/weapons/g_gl.md3");
408                         precache_model("models/weapons/v_gl.md3");
409                         precache_model("models/weapons/h_gl.iqm");
410                         precache_sound("weapons/grenade_bounce1.wav");
411                         precache_sound("weapons/grenade_bounce2.wav");
412                         precache_sound("weapons/grenade_bounce3.wav");
413                         precache_sound("weapons/grenade_bounce4.wav");
414                         precache_sound("weapons/grenade_bounce5.wav");
415                         precache_sound("weapons/grenade_bounce6.wav");
416                         precache_sound("weapons/grenade_stick.wav");
417                         precache_sound("weapons/grenade_fire.wav");
418                         MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
419                         return TRUE;
420                 }
421                 case WR_CHECKAMMO1:
422                 {
423                         ammo_amount = self.WEP_AMMO(MORTAR) >= WEP_CVAR_PRI(mortar, ammo);
424                         ammo_amount += self.(weapon_load[WEP_MORTAR]) >= WEP_CVAR_PRI(mortar, ammo);
425                         return ammo_amount;
426                 }
427                 case WR_CHECKAMMO2:
428                 {
429                         ammo_amount = self.WEP_AMMO(MORTAR) >= WEP_CVAR_SEC(mortar, ammo);
430                         ammo_amount += self.(weapon_load[WEP_MORTAR]) >= WEP_CVAR_SEC(mortar, ammo);
431                         return ammo_amount;
432                 }
433                 case WR_CONFIG:
434                 {
435                         MORTAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
436                         return TRUE;
437                 }
438                 case WR_RELOAD:
439                 {
440                         W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), "weapons/reload.wav"); // WEAPONTODO
441                         return TRUE;
442                 }
443                 case WR_SUICIDEMESSAGE:
444                 {
445                         if(w_deathtype & HITTYPE_SECONDARY)
446                                 return WEAPON_MORTAR_SUICIDE_BOUNCE;
447                         else
448                                 return WEAPON_MORTAR_SUICIDE_EXPLODE;
449                 }
450                 case WR_KILLMESSAGE:
451                 {
452                         if(w_deathtype & HITTYPE_SECONDARY)
453                                 return WEAPON_MORTAR_MURDER_BOUNCE;
454                         else
455                                 return WEAPON_MORTAR_MURDER_EXPLODE;
456                 }
457         }
458         return FALSE;
459 }
460 #endif
461 #ifdef CSQC
462 float W_Mortar(float req)
463 {
464         switch(req)
465         {
466                 case WR_IMPACTEFFECT:
467                 {
468                         vector org2;
469                         org2 = w_org + w_backoff * 12;
470                         pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
471                         if(!w_issilent)
472                                 sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
473                                 
474                         return TRUE;
475                 }
476                 case WR_INIT:
477                 {
478                         precache_sound("weapons/grenade_impact.wav");
479                         return TRUE;
480                 }
481                 case WR_ZOOMRETICLE:
482                 {
483                         // no weapon specific image for this weapon
484                         return FALSE;
485                 }
486         }
487         return FALSE;
488 }
489 #endif
490 #endif