From: Mario Date: Fri, 30 Aug 2013 10:56:16 +0000 (+1000) Subject: Remove a useless global check X-Git-Tag: xonotic-v0.8.0~241^2^2~127 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4a093a902aba2c36a30bcef342628d432e79b2f2;p=xonotic%2Fxonotic-data.pk3dir.git Remove a useless global check --- diff --git a/qcsrc/common/monsters/spawn.qc b/qcsrc/common/monsters/spawn.qc index 95e0261aeb..e8dfdd58f9 100644 --- a/qcsrc/common/monsters/spawn.qc +++ b/qcsrc/common/monsters/spawn.qc @@ -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(); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index ff18c1addf..df30e53468 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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 diff --git a/qcsrc/common/monsters/sv_monsters.qh b/qcsrc/common/monsters/sv_monsters.qh index 0ceb95852a..f27ce0072f 100644 --- a/qcsrc/common/monsters/sv_monsters.qh +++ b/qcsrc/common/monsters/sv_monsters.qh @@ -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