]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix crash
authorMario <mario@smbclan.net>
Mon, 4 Jan 2016 17:45:23 +0000 (03:45 +1000)
committerMario <mario@smbclan.net>
Mon, 4 Jan 2016 17:45:23 +0000 (03:45 +1000)
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc

index cd2804a337bc10aee7d236538cd49c0b7f8b8f4d..f65bb0cd554a728c046ae181cc5f85abaab58ed0 100644 (file)
@@ -788,8 +788,8 @@ spawnfunc(vehicle_bumblebee)
                }
                METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
                {
-                       SELFPARAM();
                        entity oldself = self;
+                       setself(instance);
 
                        CSQCModel_UnlinkEntity(self);
 
@@ -849,6 +849,8 @@ spawnfunc(vehicle_bumblebee)
                        self.nextthink          = 0;
 
                        setorigin(self, self.pos1);
+
+                       setself(oldself);
                }
                METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
                {
index 848fa2ff78fc953af82da7f8577f15efe9041165..7e9632d9644b02e1bfcec143cec79218c7f6ecd6 100644 (file)
@@ -624,31 +624,31 @@ void racer_draw()
                METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
                {
                #ifdef SVQC
-                       self.SendEntity         = func_null; // stop networking this racer (for now)
-                       self.health                     = 0;
-                       self.event_damage       = func_null;
-                       self.solid                      = SOLID_CORPSE;
-                       self.takedamage         = DAMAGE_NO;
-                       self.deadflag           = DEAD_DYING;
-                       self.movetype           = MOVETYPE_BOUNCE;
-                       self.wait                       = time;
-                       self.delay                      = 2 + time + random() * 3;
-                       self.cnt                        = 1 + random() * 2;
-                       self.touch                      = racer_deadtouch;
-
-                       Send_Effect(EFFECT_EXPLOSION_MEDIUM, self.origin, '0 0 0', 1);
+                       instance.SendEntity             = func_null; // stop networking this racer (for now)
+                       instance.health                 = 0;
+                       instance.event_damage   = func_null;
+                       instance.solid                  = SOLID_CORPSE;
+                       instance.takedamage             = DAMAGE_NO;
+                       instance.deadflag               = DEAD_DYING;
+                       instance.movetype               = MOVETYPE_BOUNCE;
+                       instance.wait                   = time;
+                       instance.delay                  = 2 + time + random() * 3;
+                       instance.cnt                    = 1 + random() * 2;
+                       instance.touch                  = racer_deadtouch;
+
+                       Send_Effect(EFFECT_EXPLOSION_MEDIUM, instance.origin, '0 0 0', 1);
 
                        if(random() < 0.5)
-                               self.avelocity_z = 32;
+                               instance.avelocity_z = 32;
                        else
-                               self.avelocity_z = -32;
+                               instance.avelocity_z = -32;
 
-                       self.avelocity_x = -vlen(self.velocity) * 0.2;
-                       self.velocity += '0 0 700';
-                       self.colormod = '-0.5 -0.5 -0.5';
+                       instance.avelocity_x = -vlen(instance.velocity) * 0.2;
+                       instance.velocity += '0 0 700';
+                       instance.colormod = '-0.5 -0.5 -0.5';
 
-                       self.think = racer_blowup_think;
-                       self.nextthink = time;
+                       instance.think = racer_blowup_think;
+                       instance.nextthink = time;
                #endif
                }
 
index d012bd57337434ed4cb22a35f1a0f340985d5352..67c67d9483cb490025519d44c6bb7c3fefdfabb9 100644 (file)
@@ -643,25 +643,25 @@ spawnfunc(vehicle_raptor)
                }
                METHOD(Raptor, vr_death, void(Raptor thisveh, entity instance))
                {
-                       self.health                             = 0;
-                       self.event_damage               = func_null;
-                       self.solid                              = SOLID_CORPSE;
-                       self.takedamage                 = DAMAGE_NO;
-                       self.deadflag                   = DEAD_DYING;
-                       self.movetype                   = MOVETYPE_BOUNCE;
-                       self.think                              = raptor_diethink;
-                       self.nextthink                  = time;
-                       self.wait                               = time + 5 + (random() * 5);
+                       instance.health                         = 0;
+                       instance.event_damage           = func_null;
+                       instance.solid                          = SOLID_CORPSE;
+                       instance.takedamage                     = DAMAGE_NO;
+                       instance.deadflag                       = DEAD_DYING;
+                       instance.movetype                       = MOVETYPE_BOUNCE;
+                       instance.think                          = raptor_diethink;
+                       instance.nextthink                      = time;
+                       instance.wait                           = time + 5 + (random() * 5);
 
-                       Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation (self.origin, 16), '0 0 0', 1);
+                       Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation (instance.origin, 16), '0 0 0', 1);
 
-                       self.velocity_z += 600;
+                       instance.velocity_z += 600;
 
-                       self.avelocity = '0 0.5 1' * (random() * 400);
-                       self.avelocity -= '0 0.5 1' * (random() * 400);
+                       instance.avelocity = '0 0.5 1' * (random() * 400);
+                       instance.avelocity -= '0 0.5 1' * (random() * 400);
 
-                       self.colormod = '-0.5 -0.5 -0.5';
-                       self.touch = raptor_blowup;
+                       instance.colormod = '-0.5 -0.5 -0.5';
+                       instance.touch = raptor_blowup;
                }
                METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance))
                {
index edb2a4758a3abcaea8df3829da48db32e5dc90d6..5bb26070d564e5d7d2523964339e85608b736641 100644 (file)
@@ -580,21 +580,21 @@ spawnfunc(vehicle_spiderbot)
                }
                METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance))
                {
-                       self.health                             = 0;
-                       self.event_damage               = func_null;
-                       self.takedamage                 = DAMAGE_NO;
-                       self.touch                              = func_null;
-                       self.cnt                                = 3.4 + time + random() * 2;
-                       self.think                              = spiderbot_blowup;
-                       self.nextthink                  = time;
-                       self.deadflag                   = DEAD_DYING;
-                       self.frame                              = 5;
-                       self.tur_head.effects  |= EF_FLAME;
-                       self.colormod                   = self.tur_head.colormod = '-1 -1 -1';
-                       self.frame                              = 10;
-                       self.movetype                   = MOVETYPE_TOSS;
-
-                       CSQCModel_UnlinkEntity(self); // networking the death scene would be a nightmare
+                       instance.health                         = 0;
+                       instance.event_damage           = func_null;
+                       instance.takedamage                     = DAMAGE_NO;
+                       instance.touch                          = func_null;
+                       instance.cnt                            = 3.4 + time + random() * 2;
+                       instance.think                          = spiderbot_blowup;
+                       instance.nextthink                      = time;
+                       instance.deadflag                       = DEAD_DYING;
+                       instance.frame                          = 5;
+                       instance.tur_head.effects  |= EF_FLAME;
+                       instance.colormod                       = instance.tur_head.colormod = '-1 -1 -1';
+                       instance.frame                          = 10;
+                       instance.movetype                       = MOVETYPE_TOSS;
+
+                       CSQCModel_UnlinkEntity(instance); // networking the death scene would be a nightmare
                }
                METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
                {