]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/intrusive 344/head
authorMario <mario@smbclan.net>
Wed, 3 Aug 2016 00:28:44 +0000 (10:28 +1000)
committerMario <mario@smbclan.net>
Wed, 3 Aug 2016 00:28:44 +0000 (10:28 +1000)
1  2 
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/server/mutators/mutator/gamemode_assault.qc

index 0d6eb3fe95943a3814eddd2f18941a4269dcd101,35fe31c2bd6ea49295a0697d68cf0e7d55c85cc0..0118e10ba865647c9057c278e48e03a5ae2cc984
@@@ -72,7 -72,7 +72,7 @@@ float OtherTeam(float t)  //works only 
  const float ST_NEXBALL_GOALS = 1;
  const float SP_NEXBALL_GOALS = 4;
  const float SP_NEXBALL_FAULTS = 5;
- void nb_ScoreRules(float teams)
+ void nb_ScoreRules(int teams)
  {
        ScoreRules_basics(teams, 0, 0, true);
        ScoreInfo_SetLabel_TeamScore(   ST_NEXBALL_GOALS,  "goals", SFL_SORT_PRIO_PRIMARY);
@@@ -376,7 -376,7 +376,7 @@@ void GoalTouch(entity this, entity touc
        EXACTTRIGGER_TOUCH(this, toucher);
  
  
-       if(nb_teams == 2)
+       if(NumTeams(nb_teams) == 2)
                otherteam = OtherTeam(ball.team);
        else
                otherteam = 0;
        else if(this.team == GOAL_FAULT)
        {
                LogNB("fault", ball.pusher);
-               if(nb_teams == 2)
+               if(NumTeams(nb_teams) == 2)
                        bprint(Team_ColoredFullName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
                else
                        bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
  
        if(ball.team && pscore)
        {
-               if(nb_teams == 2 && pscore < 0)
+               if(NumTeams(nb_teams) == 2 && pscore < 0)
                        TeamScore_AddToTeam(otherteam, ST_NEXBALL_GOALS, -pscore);
                else
                        TeamScore_AddToTeam(ball.team, ST_NEXBALL_GOALS, pscore);
@@@ -466,7 -466,7 +466,7 @@@ void nb_spawnteam(string teamname, floa
        e.netname = teamname;
        e.cnt = teamcolor;
        e.team = e.cnt + 1;
-       nb_teams += 1;
+       //nb_teams += 1;
  }
  
  void nb_spawnteams()
                        if(!t_red)
                        {
                                nb_spawnteam("Red", e.team-1)   ;
+                               nb_teams |= BIT(0);
                                t_red = true;
                        }
                        break;
                        {
                                nb_spawnteam("Blue", e.team-1)  ;
                                t_blue = true;
+                               nb_teams |= BIT(1);
                        }
                        break;
                case NUM_TEAM_3:
                        {
                                nb_spawnteam("Yellow", e.team-1);
                                t_yellow = true;
+                               nb_teams |= BIT(2);
                        }
                        break;
                case NUM_TEAM_4:
                        {
                                nb_spawnteam("Pink", e.team-1)  ;
                                t_pink = true;
+                               nb_teams |= BIT(3);
                        }
                        break;
                }
@@@ -833,7 -837,6 +837,7 @@@ void W_Nexball_Attack2(entity actor
  
        missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
        missile.flags = FL_PROJECTILE;
 +      IL_PUSH(g_projectiles, missile);
  
        CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
  }
index 696ac4a5c40399c6b3e1f107d0052b431d0bb502,4fd9a0d5231d38abfe5941e419717db50f2ae98d..19928cb0893b9c55ce86faf3b498b3fd8f1ee732
@@@ -3,20 -3,30 +3,30 @@@
  bool SendAuxiliaryXhair(entity this, entity to, int sf)
  {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
+       WriteByte(MSG_ENTITY, sf);
  
        WriteByte(MSG_ENTITY, this.cnt);
  
-       WriteCoord(MSG_ENTITY, this.origin_x);
-       WriteCoord(MSG_ENTITY, this.origin_y);
-       WriteCoord(MSG_ENTITY, this.origin_z);
+       if(sf & 2)
+       {
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
+       }
  
-       WriteByte(MSG_ENTITY, rint(this.colormod_x * 255));
-       WriteByte(MSG_ENTITY, rint(this.colormod_y * 255));
-       WriteByte(MSG_ENTITY, rint(this.colormod_z * 255));
+       if(sf & 4)
+       {
+               WriteByte(MSG_ENTITY, rint(this.colormod_x * 255));
+               WriteByte(MSG_ENTITY, rint(this.colormod_y * 255));
+               WriteByte(MSG_ENTITY, rint(this.colormod_z * 255));
+       }
  
        return true;
  }
  
+ .vector axh_prevorigin;
+ .vector axh_prevcolors;
  void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id)
  {
        if(!IS_REAL_CLIENT(own))
  
        if(axh == NULL || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist? Mario: because of sloppy code like this)
        {
-               axh                                      = spawn();
-               axh.cnt                          = axh_id;
-               axh.drawonlytoclient    = own;
-               axh.owner                          = own;
+               axh = new(auxiliary_xhair);
+               axh.cnt = axh_id;
+               axh.drawonlytoclient = own;
+               axh.owner = own;
                Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
        }
  
-       setorigin(axh, loc);
-       axh.colormod                    = clr;
-       axh.SendFlags              = 0x01;
-       own.(AuxiliaryXhair[axh_id]) = axh;
+       if(loc != axh.axh_prevorigin)
+       {
+               setorigin(axh, loc);
+               axh.SendFlags |= 2;
+       }
+       if(clr != axh.axh_prevcolors)
+       {
+               axh.colormod = clr;
+               axh.SendFlags |= 4;
+       }
+       own.(AuxiliaryXhair[axh_id]) = axh; // set it anyway...?
  }
  
  void CSQCVehicleSetup(entity own, int vehicle_id)
@@@ -228,8 -247,7 +247,8 @@@ entity vehicles_projectile(entity this
        proj.totalfrags    = _deahtype;
        proj.solid                      = SOLID_BBOX;
        set_movetype(proj, MOVETYPE_FLYMISSILE);
 -      proj.flags                      = FL_PROJECTILE;
 +      proj.flags = FL_PROJECTILE;
 +      IL_PUSH(g_projectiles, proj);
        proj.bot_dodge          = true;
        proj.bot_dodgerating  = _dmg;
        proj.velocity            = _vel;
                proj.health                = _health;
        }
        else
 -              proj.flags                 = FL_PROJECTILE | FL_NOTARGET;
 +              proj.flags |= FL_NOTARGET;
  
        if(_mzlsound != SND_Null)
                sound (this, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
@@@ -1097,10 -1115,7 +1116,10 @@@ bool vehicle_initialize(entity this, Ve
                return false;
  
        if(!this.tur_head)
 +      {
                info.vr_precache(info);
 +              IL_PUSH(g_vehicles, this);
 +      }
  
        if(this.targetname && this.targetname != "")
        {
index 191057cb64b363db2a1985181ce3c3153d1d42e8,1f8cc19441db45195999fe3262d577a09e9a8b4a..89524b154e3b3d49374773250120c791885a890f
@@@ -203,8 -203,12 +203,12 @@@ void W_Electro_TouchExplode(entity this
        W_Electro_Explode(this, toucher);
  }
  
+ void sys_phys_update_single(entity this);
  void W_Electro_Bolt_Think(entity this)
  {
+       // sys_phys_update_single(this);
        if(time >= this.ltime)
        {
                this.use(this, NULL, NULL);
                        { this.nextthink = min(time + WEP_CVAR_PRI(electro, midaircombo_interval), this.ltime); }
        }
        else { this.nextthink = this.ltime; }
+       // this.nextthink = time;
  }
  
  void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
        proj.projectiledeathtype = WEP_ELECTRO.m_id;
        setorigin(proj, w_shotorg);
  
+       // if (IS_CSQC)
        set_movetype(proj, MOVETYPE_FLY);
        W_SetupProjVelocity_PRI(proj, electro);
        proj.angles = vectoangles(proj.velocity);
        settouch(proj, W_Electro_TouchExplode);
        setsize(proj, '0 0 -3', '0 0 -3');
        proj.flags = FL_PROJECTILE;
 +      IL_PUSH(g_projectiles, proj);
        proj.missile_flags = MIF_SPLASH;
  
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
  
        MUTATOR_CALLHOOK(EditProjectile, actor, proj);
+       // proj.com_phys_pos = proj.origin;
+       // proj.com_phys_vel = proj.velocity;
  }
  
  void W_Electro_Orb_Stick(entity this, entity to)
@@@ -436,7 -443,6 +444,7 @@@ void W_Electro_Attack_Orb(Weapon thiswe
        proj.health = WEP_CVAR_SEC(electro, health);
        proj.event_damage = W_Electro_Orb_Damage;
        proj.flags = FL_PROJECTILE;
 +      IL_PUSH(g_projectiles, proj);
        proj.damagedbycontents = (WEP_CVAR_SEC(electro, damagedbycontents));
  
        proj.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor);
index d08b5a26e1ad605c4a0697e43cd7f6fec7f7bbbb,7285d7db36607738a58aa7c898a11a6c2cd5af55..3fa22343d28fdf4c6023b600050d74bcd612eb9d
@@@ -259,11 -259,10 +259,11 @@@ void assault_new_round(entity this
        // Eject players from vehicles
      FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, vehicles_exit(it.vehicle, VHEF_RELEASE));
  
 -    FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE, LAMBDA(
 +    IL_EACH(g_vehicles, true,
 +    {
          vehicles_clearreturn(it);
          vehicles_spawn(it);
 -    ));
 +    });
  
        // up round counter
        this.winning = this.winning + 1;
@@@ -668,7 -667,11 +668,11 @@@ MUTATOR_HOOKFUNCTION(as, OnEntityPreSpa
  // scoreboard setup
  void assault_ScoreRules()
  {
-       ScoreRules_basics(2, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, true);
+       int teams = 0;
+       teams |= BIT(0);
+       teams |= BIT(1); // always red vs blue
+       ScoreRules_basics(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, true);
        ScoreInfo_SetLabel_TeamScore(  ST_ASSAULT_OBJECTIVES,    "objectives",      SFL_SORT_PRIO_PRIMARY);
        ScoreInfo_SetLabel_PlayerScore(SP_ASSAULT_OBJECTIVES,    "objectives",      SFL_SORT_PRIO_PRIMARY);
        ScoreRules_basics_end();