]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_misc.qc
Avoid memory leak in the resolution slider when toggling the fullscreen
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_misc.qc
index f97f1091faeea7353b472af2e194537275a0812d..2e3a006881384a955203649f32eebd961d8f3c62 100644 (file)
@@ -45,7 +45,7 @@ vector shortangle_v(vector ang1, vector ang2)
 
 vector shortangle_vxy(vector ang1, vector ang2)
 {
-    vector vtmp;
+    vector vtmp = '0 0 0';
 
     vtmp_x = shortangle_f(ang1_x,ang2_x);
     vtmp_y = shortangle_f(ang1_y,ang2_y);
@@ -60,7 +60,7 @@ vector shortangle_vxy(vector ang1, vector ang2)
 vector real_origin(entity ent)
 {
     entity e;
-    vector v;
+    vector v = ((ent.absmin + ent.absmax) * 0.5);
 
     e = ent.tag_entity;
     while(e)
@@ -68,7 +68,7 @@ vector real_origin(entity ent)
         v = v + ((e.absmin + e.absmax) * 0.5);
         e = e.tag_entity;
     }
-    v = v + ((ent.absmin + ent.absmax) * 0.5);
+
     return v;
 }
 
@@ -113,7 +113,8 @@ vector angleofs3(vector from, vector from_a, entity to)
 * Update self.tur_shotorg by getting up2date bone info
 * NOTICE this func overwrites the global v_forward, v_right and v_up vectors.
 */
-float turret_tag_fire_update()
+#define turret_tag_fire_update() self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));v_forward = normalize(v_forward)
+float turret_tag_fire_update_s()
 {
     if(!self.tur_head)
     {
@@ -135,8 +136,8 @@ void FireImoBeam (vector start, vector end, vector smin, vector smax,
                   float bforce, float f_dmg, float f_velfactor, float deathtype)
 
 {
-    local vector hitloc, force, endpoint, dir;
-    local entity ent;
+    vector hitloc, force, endpoint, dir;
+    entity ent;
 
     dir = normalize(end - start);
     force = dir * bforce;