]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/sv_main.qc
Monsters!
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / sv_main.qc
index 007c6369ede68e3e5239d1b774076b1cf65e3840..579afd544718e0cbec1ba923afc90dda3cb29d36 100644 (file)
@@ -10,6 +10,7 @@ void CreatureFrame (void)
                
                float vehic = (self.vehicle_flags & VHF_ISVEHICLE);
                float projectile = (self.flags & FL_PROJECTILE);
+               float monster = (self.flags & FL_MONSTER);
                
                if (self.watertype <= CONTENT_WATER && self.waterlevel > 0) // workaround a retarded bug made by id software :P (yes, it's that old of a bug)
                {
@@ -19,7 +20,7 @@ void CreatureFrame (void)
                                self.dmgtime = 0;
                        }
 
-                       if(!vehic && !projectile) // vehicles and projectiles don't drown
+                       if(!vehic && !projectile && !monster) // vehicles, monsters and projectiles don't drown
                        {
                                if (self.waterlevel != WATERLEVEL_SUBMERGED)
                                {
@@ -43,7 +44,18 @@ void CreatureFrame (void)
                        {
                                self.dmgtime = time + autocvar_g_balance_contents_damagerate; 
                                
-                               if (!projectile)
+                               if (projectile)
+                               {
+                                       if (self.watertype == CONTENT_LAVA)
+                                       {
+                                               Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
+                                       }
+                                       else if (self.watertype == CONTENT_SLIME)
+                                       {
+                                               Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
+                                       }
+                               }
+                               else
                                {
                                        if (self.watertype == CONTENT_LAVA)
                                        {
@@ -64,10 +76,6 @@ void CreatureFrame (void)
                                                Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
                                        }
                                }
-                               else if ((self.watertype == CONTENT_LAVA) || (self.watertype == CONTENT_SLIME))
-                               {
-                                       Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
-                               }
                        }
                }
                else
@@ -231,8 +239,6 @@ void StartFrame (void)
        CreatureFrame ();
        CheckRules_World ();
 
-       AuditTeams();
-
        RuneMatchGivePoints();
        bot_serverframe();