]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nades/nades.qc
Merge branch 'master' into Mario/intrusive_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nades / nades.qc
index b8d100786441391889863a9485c9d450cd0009fc..e3cb6d6ea43a9aef2ab6bd83d9c19fc71df091df 100644 (file)
@@ -7,7 +7,7 @@ float autocvar_g_nades_spread = 0.04;
 
 REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
 
-#ifndef MENUQC
+#ifdef GAMEQC
 entity Nade_TrailEffect(int proj, int nade_team)
 {
     switch (proj)
@@ -145,8 +145,8 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
 
 #ifdef SVQC
 
-#include <common/gamemodes/_all.qh>
-#include <common/monsters/spawn.qh>
+#include <common/gamemodes/_mod.qh>
+#include <common/monsters/sv_spawn.qh>
 #include <common/monsters/sv_monsters.qh>
 #include <server/g_subs.qh>
 
@@ -293,6 +293,7 @@ void nade_napalm_ball(entity this)
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, proj);
+       IL_PUSH(g_bot_dodge, proj);
        proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
 
        //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
@@ -349,6 +350,9 @@ void nade_napalm_boom(entity this)
        fountain.owner = this.owner;
        fountain.realowner = this.realowner;
        fountain.origin = this.origin;
+       fountain.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, fountain);
+       IL_PUSH(g_bot_dodge, fountain);
        setorigin(fountain, fountain.origin);
        setthink(fountain, napalm_fountain_think);
        fountain.nextthink = time;
@@ -730,10 +734,9 @@ void nade_boom(entity this)
                case NADE_TYPE_ENTRAP: nade_entrap_boom(this); break;
        }
 
-       FOREACH_ENTITY_ENT(aiment, this,
+       IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
        {
-               if(it.classname == "grapplinghook")
-                       RemoveGrapplingHook(it.realowner);
+               RemoveGrapplingHook(it.realowner);
        });
 
        delete(this);
@@ -780,10 +783,9 @@ void nade_touch(entity this, entity toucher)
                is_weapclip = 1;*/
        if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip)
        {
-               FOREACH_ENTITY_ENT(aiment, this,
+               IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
                {
-                       if(it.classname == "grapplinghook")
-                               RemoveGrapplingHook(it.realowner);
+                       RemoveGrapplingHook(it.realowner);
                });
                delete(this);
                return;
@@ -939,9 +941,11 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
        _nade.gravity = 1;
        _nade.missile_flags = MIF_SPLASH | MIF_ARC;
        _nade.damagedbycontents = true;
+       IL_PUSH(g_damagedbycontents, _nade);
        _nade.angles = vectoangles(_nade.velocity);
        _nade.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, _nade);
+       IL_PUSH(g_bot_dodge, _nade);
        _nade.projectiledeathtype = DEATH_NADE.m_id;
        _nade.toss_time = time;
        _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);