]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove a useless global check
authorMario <mario.mario@y7mail.com>
Fri, 30 Aug 2013 10:56:16 +0000 (20:56 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 30 Aug 2013 10:56:16 +0000 (20:56 +1000)
qcsrc/common/monsters/spawn.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/monsters/sv_monsters.qh

index 95e0261aeb511687fe40ae57497945b2a10eaff8..e8dfdd58f951c85af22751e00cbd8361e25e5778 100644 (file)
@@ -1,10 +1,7 @@
 entity spawnmonster (string monster, float mnster, entity spawnedby, entity own, vector orig, float respwn, float moveflag)
 {
-       if(!spawncode_first_load)
-       {
-               initialize_field_db();
-               spawncode_first_load = TRUE;
-       }
+       // ensure spawnfunc database is initialized
+       initialize_field_db();
        
        entity e = spawn();
        
index ff18c1addfac79f8fa8827d0c87d5510bfd20529..df30e5346876ea75e21f3b3df3c23d583bf09812 100644 (file)
@@ -281,7 +281,7 @@ void Monster_Fade ()
                self.takedamage = DAMAGE_NO;
                setorigin(self, self.pos1);
                self.angles = self.pos2;
-               self.health = self.max_health; // TODO: check if resetting to max_health is wise here
+               self.health = self.max_health;
                
                self.SendFlags |= MSF_MOVE;
                self.SendFlags |= MSF_STATUS;
@@ -863,12 +863,10 @@ void monsters_damage (entity inflictor, entity attacker, float damage, float dea
        }
                
        if(self.health <= 0)
-       {        
+       {
+               // Update one more time to avoid waypoint fading without emptying healthbar
                if(self.sprite)
-               {
-                       // Update one more time to avoid waypoint fading without emptying healthbar
                        WaypointSprite_UpdateHealth(self.sprite, 0);
-               }
                
                if(deathtype == DEATH_KILL)
                        self.candrop = FALSE; // killed by mobkill command
index 0ceb95852aab624a7b27d564b6fe6cd07a455807..f27ce0072ff45e0030755f035f6b3b07c73f72ef 100644 (file)
@@ -2,7 +2,6 @@
 .float monster_attack;
 
 float monster_skill;
-float spawncode_first_load; // used to tell the player the monster database is loading (TODO: fix this?)
 
 .entity monster_owner; // new monster owner entity, fixes non-solid monsters
 .float monstercount; // per player monster count