]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/sv_spawn.qc
Fix invasion
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / sv_spawn.qc
index 6d9daa2964cbb4c6c5c1d4c25561e22fcf2c2731..497dee86664b54d644f405e4be5ea47fc01969e9 100644 (file)
@@ -69,7 +69,11 @@ entity spawnmonster (entity e, string monster, int monster_id, entity spawnedby,
        }
 
        // Monster_Spawn checks if monster is valid
-       Monster_Spawn(e, false, monster_id);
+       if(!Monster_Spawn(e, false, monster_id))
+       {
+               delete(e);
+               return NULL; // remove even if told not to, as we didn't spawn any kind of monster
+       }
 
        return e;
 }