]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/spiderbot.qc
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / spiderbot.qc
index ca72ec1b23b034658bcb8617a9e60a2f9a4c9a21..460f6edf4bc377561c3a132c3b7eae032b977b4f 100644 (file)
@@ -1,5 +1,9 @@
 #include "spiderbot.qh"
 
+#if defined(SVQC)
+       #include <common/gamemodes/gamemode/ctf/sv_ctf.qh>
+#endif
+
 #ifdef GAMEQC
 
 const int SBRM_FIRST = 1;
@@ -266,7 +270,7 @@ bool spiderbot_frame(entity this, float dt)
 
                        .entity weaponentity = weaponentities[0]; // TODO: unhardcode
                        fireBullet(this, weaponentity, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
-                               autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, EFFECT_BULLET);
+                               autocvar_g_vehicle_spiderbot_minigun_damage, 0, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, EFFECT_BULLET);
 
                        sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
                        //trailparticles(this, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
@@ -402,7 +406,7 @@ void spiderbot_blowup(entity this)
                return;
        }
 
-       entity h = spawn(), g1 = spawn(), g2 = spawn(), b = spawn();
+       entity h = new(spiderbot_top), g1 = new(spiderbot_gun), g2 = new(spiderbot_gun), b = new(spiderbot_body);
 
        setmodel(b, MDL_VEH_SPIDERBOT_BODY);
        setmodel(h, MDL_VEH_SPIDERBOT_TOP);
@@ -414,10 +418,10 @@ void spiderbot_blowup(entity this)
        b.angles = this.angles;
        setsize(b, this.mins, this.maxs);
 
+       h.solid = SOLID_BBOX; // before setorigin for immediate area grid linking
        vector org = gettaginfo(this, gettagindex(this, "tag_head"));
        setorigin(h, org);
        set_movetype(h, MOVETYPE_BOUNCE);
-       h.solid = SOLID_BBOX;
        h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
        h.modelflags = MF_ROCKET;
        h.effects = EF_FLAME | EF_LOWPRECISION;
@@ -430,17 +434,17 @@ void spiderbot_blowup(entity this)
        setthink(h, spiderbot_headfade);
        h.nextthink = time;
 
+       g1.solid = SOLID_CORPSE; // before setorigin for immediate area grid linking
        org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint01"));
        setorigin(g1, org);
        set_movetype(g1, MOVETYPE_TOSS);
-       g1.solid = SOLID_CORPSE;
        g1.velocity = v_forward * 700 + (randomvec() * 32);
        g1.avelocity = randomvec() * 180;
 
+       g2.solid = SOLID_CORPSE; // before setorigin for immediate area grid linking
        org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint02"));
        setorigin(g2, org);
        set_movetype(g2, MOVETYPE_TOSS);
-       g2.solid = SOLID_CORPSE;
        g2.velocity = v_forward * 700 + (randomvec() * 32);
        g2.avelocity = randomvec() * 180;
 
@@ -563,8 +567,8 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
     if(!instance.gun1)
     {
         instance.vehicles_impulse = spiderbot_impulse;
-        instance.gun1 = spawn();
-        instance.gun2 = spawn();
+        instance.gun1 = new(spiderbot_gun);
+        instance.gun2 = new(spiderbot_gun);
         setmodel(instance.gun1, MDL_VEH_SPIDERBOT_GUN);
         setmodel(instance.gun2, MDL_VEH_SPIDERBOT_GUN);
         setattachment(instance.gun1, instance.tur_head, "tag_hardpoint01");