]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/csqc_models
authorMario <mario.mario@y7mail.com>
Sat, 2 Nov 2013 07:32:28 +0000 (18:32 +1100)
committerMario <mario.mario@y7mail.com>
Sat, 2 Nov 2013 07:32:28 +0000 (18:32 +1100)
1  2 
qcsrc/client/hud.qc
qcsrc/client/miscfunctions.qc
qcsrc/server/func_breakable.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/sandbox.qc

diff --combined qcsrc/client/hud.qc
index 7dfaa94859ec737136ee05643720959896484be4,293ad379e1d9bd3550a3cc20d7895196a1e754b4..fa22178ecc9f77065a90a21acaf4f870393dd7cf
@@@ -142,16 -142,16 +142,16 @@@ float stringwidth_nocolors(string s, ve
        return stringwidth(s, FALSE, theSize);
  }
  
 -void drawstringright(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
 +void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
  {
 -      position_x -= 2 / 3 * strlen(text) * scale_x;
 -      drawstring(position, text, scale, rgb, theAlpha, flag);
 +      position_x -= 2 / 3 * strlen(text) * theScale_x;
 +      drawstring(position, text, theScale, rgb, theAlpha, flag);
  }
  
 -void drawstringcenter(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
 +void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
  {
 -      position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x);
 -      drawstring(position, text, scale, rgb, theAlpha, flag);
 +      position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale_x);
 +      drawstring(position, text, theScale, rgb, theAlpha, flag);
  }
  
  // return the string of the onscreen race timer
@@@ -242,7 -242,7 +242,7 @@@ float GetPlayerColorForce(float i
  
  float GetPlayerColor(float i)
  {
-       if not(playerslots[i].gotscores) // unconnected
+       if(!playerslots[i].gotscores) // unconnected
                return NUM_SPECTATOR;
        else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
                return NUM_SPECTATOR;
@@@ -734,7 -734,7 +734,7 @@@ void HUD_Weapons(void
  
                // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
                if(autocvar_hud_panel_weapons_onlyowned)
-               if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))
+               if (!((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon)))
                        continue;
  
                // figure out the drawing position of weapon
@@@ -1133,7 -1133,7 +1133,7 @@@ void HUD_Powerups(void
        {
                if(!autocvar_hud_panel_powerups) return;
                if(spectatee_status == -1) return;
-               if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return;
+               if(!(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON))) return;
                if (getstati(STAT_HEALTH) <= 0) return;
  
                strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
@@@ -3123,7 -3123,7 +3123,7 @@@ void HUD_Mod_Race(vector pos, vector my
        float f; // yet another function has this
        score = me.(scores[ps_primary]);
  
-       if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
+       if(!(scores_flags[ps_primary] & SFL_TIME) || teamplay) // race/cts record display on HUD
                return; // no records in the actual race
  
        // clientside personal record
index cdd55f8a4c5d7c6d9a719c07210f45f9b49fa9b6,7f1b893a7c5c28691d5a8ce127ea0bd9ed1d0a8b..eb91814f670bb2cfa707a1f25a32483874d1ce86
@@@ -111,7 -111,7 +111,7 @@@ entity GetTeam(float Team, float add
        num = (Team == NUM_SPECTATOR) ? 16 : Team;
        if(teamslots[num])
                return teamslots[num];
-       if not(add)
+       if (!add)
                return world;
        tm = spawn();
        tm.team = Team;
@@@ -302,18 -302,18 +302,18 @@@ var string _drawpic_picpath
                _drawpic_picpath = string_null;\
        } while(0)
  
 -void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
 +void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
  {
        float sz;
        sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
  
 -      drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag);
 +      drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, theScale, 1), pic, theScale * sz, rgb, theAlpha * (1 - fadelerp), flag);
  }
  
 -void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
 +void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
  {
 -      drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp);
 -      drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag);
 +      drawpic_aspect_skin_expanding(position, pic, theScale, rgb, theAlpha, flag, fadelerp);
 +      drawpic_skin(position, pic, theScale, rgb, theAlpha * fadelerp, flag);
  }
  #define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
        float textaspect, oldsz;\
@@@ -341,14 -341,14 +341,14 @@@ void drawcolorcodedstring_aspect(vecto
  }
  
  vector drawfontscale;
 -void drawstring_expanding(vector position, string text, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
 +void drawstring_expanding(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
  {
        float sz;
        sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
  
        drawfontscale = sz * '1 1 0';
        dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
 -      drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
 +      drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, FALSE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
        // width parameter:
        //    (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
        //    SIZE1
@@@ -361,14 -361,14 +361,14 @@@ void drawstring_aspect_expanding(vecto
        drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp);
  }
  
 -void drawcolorcodedstring_expanding(vector position, string text, vector scale, float theAlpha, float flag, float fadelerp)
 +void drawcolorcodedstring_expanding(vector position, string text, vector theScale, float theAlpha, float flag, float fadelerp)
  {
        float sz;
        sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
  
        drawfontscale = sz * '1 1 0';
        dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
 -      drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
 +      drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, TRUE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
        drawfontscale = '1 1 0';
  }
  
@@@ -385,7 -385,7 +385,7 @@@ float PolyDrawModelSurface(entity e, fl
        vector tri;
        string tex;
        tex = getsurfacetexture(e, i_s);
-       if not(tex)
+       if (!tex)
                return 0; // this is beyond the last one
        n_t = getsurfacenumtriangles(e, i_s);
        for(i_t = 0; i_t < n_t; ++i_t)
index 8db84027e13e41170d460c70cb489f409d51e458,a8dea48ef31640c84aaa9df219ab8192da304e15..d67e79cd4d3396e45b74e9747291036680fc968d
@@@ -70,7 -70,7 +70,7 @@@ void LaunchDebris (string debrisname, v
  void func_breakable_colormod()
  {
        float h;
-       if not(self.spawnflags & 2)
+       if (!(self.spawnflags & 2))
                return;
        h = self.health / self.max_health;
        if(h < 0.25)
@@@ -79,8 -79,6 +79,8 @@@
                self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
        else
                self.colormod = '1 1 1';
 +              
 +      CSQCMODEL_AUTOUPDATE();
  }
  
  void func_breakable_look_destroyed()
@@@ -142,16 -140,12 +142,16 @@@ void func_breakable_destroyed(
  {
        func_breakable_look_destroyed();
        func_breakable_behave_destroyed();
 +      
 +      CSQCMODEL_AUTOUPDATE();
  }
  
  void func_breakable_restore()
  {
        func_breakable_look_restore();
        func_breakable_behave_restore();
 +      
 +      CSQCMODEL_AUTOUPDATE();
  }
  
  vector debrisforce; // global, set before calling this
@@@ -223,8 -217,6 +223,8 @@@ void func_breakable_reset(
                func_breakable_behave_destroyed();
        else
                func_breakable_behave_restore();
 +              
 +      CSQCMODEL_AUTOUPDATE();
  }
  
  // destructible walls that can be used to trigger target_objective_decrease
@@@ -276,8 -268,6 +276,8 @@@ void spawnfunc_func_breakable() 
  
        self.reset = func_breakable_reset;
        func_breakable_reset();
 +      
 +      CSQCMODEL_AUTOINIT();
  }
  
  // for use in maps with a "model" key set
index 91f9c912b4055bd603a7a71dd4613b17047a1eff,a419d7b1f3b416525f2839ecc4f218d98aef9483..fd7f305c910c2859bd528e72d5fb9ec29ae62aba
@@@ -510,7 -510,7 +510,7 @@@ void onslaught_generator_deaththink(
        vector org;
        float i;
  
-       if not (self.count)
+       if (!self.count)
                self.count = 40;
  
        // White shockwave
@@@ -614,7 -614,7 +614,7 @@@ void onslaught_generator_damage(entity 
  #endif
                self.lasthealth = self.health;
        }
-       else if not(warmup_stage)
+       else if (!warmup_stage)
        {
                if (attacker == self)
                        bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n");
@@@ -1271,7 -1271,7 +1271,7 @@@ void onslaught_controlpoint_touch(
  {
        entity e;
        float a;
-       if not(IS_PLAYER(other))
+       if (!IS_PLAYER(other))
                return;
        a = onslaught_controlpoint_attackable(self, other.team);
        if(a != 2 && a != 4)
        onslaught_updatelinks();
  }
  
 +void onslaught_controlpoint_think()
 +{
 +      self.nextthink = time;
 +      CSQCMODEL_AUTOUPDATE();
 +}
 +
  void onslaught_controlpoint_reset()
  {
        if(self.goalentity && self.goalentity != world)
        self.isshielded = TRUE;
        self.enemy.solid = SOLID_NOT;
        self.enemy.colormap = self.colormap;
 -      self.think = self.enemy.think = func_null;
 -      self.nextthink = 0; // don't like func_null :P
 +      self.think = onslaught_controlpoint_think;
 +      self.enemy.think = func_null;
 +      self.nextthink = time; // don't like func_null :P
        setmodel(self, "models/onslaught/controlpoint_pad.md3");
        //setsize(self, '-32 -32 0', '32 32 8');
  
  
        activator = self;
        SUB_UseTargets(); // to reset the structures, playerspawns etc.
 +      
 +      CSQCMODEL_AUTOUPDATE();
  }
  
  /*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128)
@@@ -1406,9 -1397,6 +1406,9 @@@ void spawnfunc_onslaught_controlpoint(
        self.enemy.colormap = self.colormap;
  
        waypoint_spawnforitem(self);
 +      
 +      self.think = onslaught_controlpoint_think;
 +      self.nextthink = time;
  
        WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
        WaypointSprite_UpdateRule(self.sprite, NUM_TEAM_2, SPRITERULE_TEAMPLAY);
        onslaught_updatelinks();
  
        self.reset = onslaught_controlpoint_reset;
 +      
 +      CSQCMODEL_AUTOINIT();
  }
  
  float onslaught_link_send(entity to, float sendflags)
index daaad42ec2ee5305f7eaf0bfe4703be0c6931b0d,a077b213a00b6b60f21a7f7844273843ea7f626b..e84c6d696a91e691ccadabf6c68cd927febbc97f
@@@ -20,7 -20,7 +20,7 @@@ void sandbox_ObjectFunction_Touch(
        intensity = vlen(self.velocity) + vlen(other.velocity);
        if(intensity) // avoid divisions by 0
                intensity /= 2; // average the two velocities
-       if not(intensity >= autocvar_g_sandbox_object_material_velocity_min)
+       if (!(intensity >= autocvar_g_sandbox_object_material_velocity_min))
                return; // impact not strong enough to do anything
        // now offset intensity and apply it to the effects
        intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
@@@ -56,8 -56,6 +56,8 @@@ void sandbox_ObjectFunction_Think(
        }
  
        self.nextthink = time;
 +      
 +      CSQCMODEL_AUTOUPDATE();
  }
  
  .float old_solid, old_movetype;
@@@ -76,7 -74,7 +76,7 @@@ entity sandbox_ObjectEdit_Get(float per
                return trace_ent; // don't check permissions, anyone can edit this object
        if(trace_ent.crypto_idfp == "")
                return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it
-       if not(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2)
+       if (!(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2))
                return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server
        return world;
  }
@@@ -139,7 -137,7 +139,7 @@@ entity sandbox_ObjectSpawn(float databa
  {
        // spawn a new object with default properties
  
 -      entity e;
 +      entity e, oldself;
        e = spawn();
        e.classname = "object";
        e.takedamage = DAMAGE_AIM;
                setorigin(e, trace_endpos);
                e.angles_y = self.v_angle_y;
        }
 +      
 +      oldself = self;
 +      self = e;
 +      CSQCMODEL_AUTOINIT();
 +      self = oldself;
  
        object_count += 1;
        return e;
@@@ -491,7 -484,7 +491,7 @@@ MUTATOR_HOOKFUNCTION(sandbox_PlayerComm
                                        print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object without specifying a model. Please specify the path to your model file after the 'object_spawn' command");
                                        return TRUE;
                                }
-                               if not(fexists(argv(2)))
+                               if (!(fexists(argv(2))))
                                {
                                        print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object with a non-existent model. Make sure the path to your model file is correct");
                                        return TRUE;