From ee55874cbbc17d0a9e59152be869961d2f1c3ef4 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 2 Sep 2013 03:41:35 +1000 Subject: [PATCH] Disallow changing monster's name --- qcsrc/common/monsters/sv_monsters.qc | 8 +++----- qcsrc/common/monsters/sv_monsters.qh | 10 ++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 4f73eee3a..b3c3fd396 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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; diff --git a/qcsrc/common/monsters/sv_monsters.qh b/qcsrc/common/monsters/sv_monsters.qh index 32f372ede..6f5271d65 100644 --- a/qcsrc/common/monsters/sv_monsters.qh +++ b/qcsrc/common/monsters/sv_monsters.qh @@ -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; -- 2.39.2