]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nades/nades.qc
Merge branch 'morosophos/xdf-speed-cfg-fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nades / nades.qc
index 04c61a6d73c5e8cf23c135e780372cb892d6a74e..7a00bd686b5b122b4b481e42fced7119becc67ce 100644 (file)
@@ -11,6 +11,7 @@ float autocvar_g_nades_spread = 0.04;
 REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
 
 #ifdef GAMEQC
+
 REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
 REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
 
@@ -589,9 +590,9 @@ void nade_entrap_touch(entity this, entity toucher)
        #endif
        }
 
-       if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+       if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
        {
-               entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
+               entity show_tint = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
                STAT(ENTRAP_ORB, show_tint) = time + 0.1;
 
                float tint_alpha = 0.75;
@@ -645,9 +646,9 @@ void nade_heal_touch(entity this, entity toucher)
 
        }
 
-       if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) )
+       if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
        {
-               entity show_red = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
+               entity show_red = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
                STAT(HEALING_ORB, show_red) = time+0.1;
                STAT(HEALING_ORB_ALPHA, show_red) = 0.75 * (this.ltime - time) / this.orb_lifetime;
        }
@@ -674,9 +675,9 @@ void nade_monster_boom(entity this)
 
 void nade_veil_touch(entity this, entity toucher)
 {
-       if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+       if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
        {
-               entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
+               entity show_tint = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
 
                float tint_alpha = 0.75;
                if(SAME_TEAM(toucher, this.realowner))