]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix scrag not falling when killed
authorMario <mario.mario@y7mail.com>
Sat, 13 Apr 2013 16:18:21 +0000 (02:18 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 13 Apr 2013 16:18:21 +0000 (02:18 +1000)
qcsrc/client/monsters.qc
qcsrc/server/monsters/lib/monsters.qc
qcsrc/server/monsters/monster/wizard.qc

index 516700de007cecc74ee07ee45447e7b8d080a109..ec1919d62a31ac5683ca35485adcfd5fde347e67 100644 (file)
@@ -262,6 +262,14 @@ void monster_changeteam()
                self.colormap = 1024 + (self.team - 1) * 17;
 }
 
+void monster_die()
+{
+       if(self.monsterid == MONSTER_SPIDER)
+               self.angles += '180 0 0';
+               
+       self.solid = SOLID_CORPSE;
+}
+
 void monster_draw()
 {        
     float dt;
@@ -383,8 +391,7 @@ void ent_monster()
                _tmp = ReadByte();
                
                if(_tmp == 0 && self.health != 0)
-               if(self.monsterid == MONSTER_SPIDER)
-                       self.angles += '180 0 0';
+                       monster_die();
 
                self.health = _tmp;
        }
index 083f07ac90af840e466aadbc555838f044ea7e51..bf12cb4e8a815b9f94fcad36c45fcba59b149fc8 100644 (file)
@@ -833,8 +833,6 @@ void monsters_damage (entity inflictor, entity attacker, float damage, float dea
                frag_target = self;
                MUTATOR_CALLHOOK(MonsterDies);
                
-               self.SendFlags |= MSF_MOVE;
-               
                if(self.health <= -100) // check if we're already gibbed
                {
                        Violence_GibSplash(self, 1, 0.5, attacker);
@@ -874,6 +872,12 @@ void monster_hook_death()
        self.takedamage         = DAMAGE_AIM;
        self.enemy                      = world;
        self.movetype           = MOVETYPE_TOSS;
+       self.moveto                     = self.origin;
+       
+       if not(self.flags & FL_FLY)
+               self.velocity = '0 0 0';
+       
+       self.SendFlags |= MSF_MOVE;
                
        totalspawned -= 1;
 }
index cc9374807f49f05af52416f8630f392976080423..e87555f8b76c580899f8f5269a74698edf21caeb 100644 (file)
@@ -37,14 +37,10 @@ void Wiz_FastExplode()
 
 void Wiz_FastTouch ()
 {
-       PROJECTILE_TOUCH;
-       
        if(other == self.owner)
                return;
                
-       if(teamplay)
-       if(other.team == self.owner.team)
-               return;
+       PROJECTILE_TOUCH;
                
        pointparticles(particleeffectnum("TE_WIZSPIKE"), self.origin, '0 0 0', 1);
        
@@ -53,17 +49,10 @@ void Wiz_FastTouch ()
 
 void Wiz_StartFast ()
 {
-       local   entity  missile;
-       local   vector  dir = '0 0 0';
-       local   float   dist = 0, flytime = 0;
+       entity missile;
+       vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
        
        self.attack_finished_single = time + 0.2;
-
-       dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
-       dist = vlen (self.enemy.origin - self.origin);
-       flytime = dist * 0.002;
-       if (flytime < 0.1)
-               flytime = 0.1;
        
        self.v_angle = self.angles;
        makevectors (self.angles);
@@ -112,13 +101,27 @@ void wizard_fastattack ()
        Wiz_StartFast();
 }
 
+void wizard_dead_think()
+{
+       self.think = wizard_dead_think;
+       self.nextthink = time + self.ticrate;
+
+       if(time >= self.ltime)
+       {
+               Monster_Fade();
+               return;
+       }
+       
+       self.SendFlags |= MSF_MOVE; // keep up to date on the monster's location
+}
+
 void wizard_die ()
 {
        Monster_CheckDropCvars ("wizard");
        
-       self.think                      = Monster_Fade;
-       self.nextthink          = time + 5;
-       self.flags                      = FL_ONGROUND;
+       self.think                      = wizard_dead_think; // exception for wizard, as it needs to keep moving
+       self.ltime                      = time + 5;
+       self.nextthink          = time + self.ticrate;
        self.velocity_x         = -200 + 400 * random();
        self.velocity_y         = -200 + 400 * random();
        self.velocity_z         = 100 + 100 * random();