]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/spiderbot.qc
Fix vehicles getting attacked by turrets when the game is over
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / spiderbot.qc
index fc8a4f190b1be8b6feb8a6f6872e4487aebc7dd0..347d2120aa1a17155db038821fbfcdc6f880c5f8 100644 (file)
@@ -50,8 +50,9 @@ bool spiderbot_frame(entity this, float dt)
 
        if(intermission_running)
        {
-               vehic.velocity = '0 0 0';
-               vehic.avelocity = '0 0 0';
+               vehic.solid = SOLID_NOT;
+               vehic.takedamage = DAMAGE_NO;
+               set_movetype(vehic, MOVETYPE_NONE);
                return;
        }
 
@@ -314,9 +315,8 @@ void spiderbot_exit(entity this, int eject)
 {
        vector spot;
 
-       FOREACH_ENTITY_ENT(owner, this.owner,
+       IL_EACH(g_projectiles, it.owner == this.owner && it.classname == "spiderbot_rocket",
        {
-               if(it.classname != "spiderbot_rocket") continue;
                it.realowner = this.owner;
                it.owner = NULL;
        });