]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disallow changing monster's name
authorMario <mario.mario@y7mail.com>
Sun, 1 Sep 2013 17:41:35 +0000 (03:41 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 1 Sep 2013 17:41:35 +0000 (03:41 +1000)
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/monsters/sv_monsters.qh

index 4f73eee3aa6bbcedcae3d86ed00bd1e984ab2432..b3c3fd396fa93d7c431d50cac7ab0e7abaeb0d13 100644 (file)
@@ -969,15 +969,12 @@ float monster_initialize(float mon_id, float nodrop)
        // support for quake style removing monsters based on skill
        switch(monster_skill)
        {
+               case 0:
                case 1: if(self.spawnflags & MONSTERSKILL_NOTEASY)              return FALSE; break;
                case 2: if(self.spawnflags & MONSTERSKILL_NOTMEDIUM)    return FALSE; break;
+               default:
                case 3: if(self.spawnflags & MONSTERSKILL_NOTHARD)              return FALSE; break;
-               case 4: if(self.spawnflags & MONSTERSKILL_NOTINSANE)    return FALSE; break;
-               case 5: if(self.spawnflags & MONSTERSKILL_NOTNIGHTMARE) return FALSE; break;
        }
-
-       if(self.monster_name == "")
-               self.monster_name = M_NAME(mon_id);
        
        if(self.team && !teamplay)
                self.team = 0;
@@ -992,6 +989,7 @@ float monster_initialize(float mon_id, float nodrop)
        max_s = mon.maxs;
        
        self.netname = mon.netname;
+       self.monster_name = M_NAME(mon_id);
 
        setsize(self, min_s, max_s);
        self.takedamage                 = DAMAGE_AIM;
index 32f372edeeea4ef8900a1f5f1d2e074ab832b8c2..6f5271d654dee0245fbabde503b0a2b0959bde51 100644 (file)
@@ -32,11 +32,9 @@ const float MONSTER_ATTACK_RANGED    = 2;
 
 float monsters_spawned;
 
-const float MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 2
-const float MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 3
-const float MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill 4
-const float MONSTERSKILL_NOTINSANE = 2048; // monster will not spawn on skill 5
-const float MONSTERSKILL_NOTNIGHTMARE = 4096; // monster will not spawn on skill >= 6
+const float MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1
+const float MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2
+const float MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3
 
 // new flags
 const float MONSTERFLAG_MINIBOSS = 1;  // monster spawns as mini-boss (also has a chance of naturally becoming one)
@@ -44,7 +42,7 @@ const float MONSTERFLAG_APPEAR = 2; // delay spawn until triggered
 const float MONSTERFLAG_NORESPAWN = 4;
 const float MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically
 const float MONSTERFLAG_INFRONT = 16; // only check for enemies infront of us
-const float MONSTERFLAG_SPAWNED = 512; // flag for spawned monsters
+const float MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters
 
 .float msound_delay; // restricts some monster sounds
 .string msound_idle;