]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
authorLyberta <lyberta@lyberta.net>
Tue, 24 Apr 2018 19:09:38 +0000 (22:09 +0300)
committerLyberta <lyberta@lyberta.net>
Tue, 24 Apr 2018 19:09:38 +0000 (22:09 +0300)
1  2 
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/server/client.qc
qcsrc/server/defs.qh
xonotic-server.cfg

diff --combined qcsrc/client/view.qc
index f64e2c21f62d95ffee269be1c6b72a1422ef85ec,42a8820e761be63bcfed9abec1676438434f4a72..f2196cd1c9de15ede096db44acca2ee6de0c1f5e
@@@ -30,7 -30,6 +30,7 @@@
  
  #include <common/vehicles/all.qh>
  #include <common/weapons/_all.qh>
 +#include <common/mutators/mutator/overkill/oknex.qh>
  #include <common/viewloc.qh>
  #include <common/triggers/trigger/viewloc.qh>
  #include <common/minigames/cl_minigames.qh>
@@@ -699,7 -698,6 +699,7 @@@ float TrueAimCheck(entity wepent
                case WEP_MORTAR: // toss curve
                        return SHOTTYPE_HITWORLD;
                case WEP_VORTEX:
 +              case WEP_OVERKILL_NEX:
                case WEP_VAPORIZER:
                        mv = MOVE_NORMAL;
                        break;
@@@ -1230,8 -1228,6 +1230,8 @@@ void HUD_Crosshair(entity this
                                float arc_heat = wepent.arc_heat_percent;
                                float vcharge = wepent.vortex_charge;
                                float vchargepool = wepent.vortex_chargepool_ammo;
 +                              float oknex_charge_ = wepent.oknex_charge;
 +                              float oknex_chargepool_ = wepent.oknex_chargepool_ammo;
  
                                if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
                                        vortex_charge_movingavg = vcharge;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring_nexgun.tga";
                                }
 +                              else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_NEX) && oknex_charge_ && autocvar_crosshair_ring_vortex)
 +                              {
 +                                      if (oknex_chargepool_ || use_vortex_chargepool) {
 +                                              use_vortex_chargepool = 1;
 +                                              ring_inner_value = oknex_chargepool_;
 +                                      } else {
 +                                              vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * oknex_charge_;
 +                                              ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (oknex_charge_ - vortex_charge_movingavg), 1);
 +                                      }
 +
 +                                      ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
 +                                      ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
 +                                      ring_inner_image = "gfx/crosshair_ring_inner.tga";
 +
 +                                      // draw the outer ring to show the current charge of the weapon
 +                                      ring_value = oknex_charge_;
 +                                      ring_alpha = autocvar_crosshair_ring_vortex_alpha;
 +                                      ring_rgb = wcross_color;
 +                                      ring_image = "gfx/crosshair_ring_nexgun.tga";
 +                              }
                                else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
                                {
                                        ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
                wcross_scale_goal_prev = 0;
                wcross_alpha_goal_prev = 0;
                wcross_changedonetime = 0;
-               if(wcross_name_goal_prev)
-                       strunzone(wcross_name_goal_prev);
-               wcross_name_goal_prev = string_null;
-               if(wcross_name_goal_prev_prev)
-                       strunzone(wcross_name_goal_prev_prev);
-               wcross_name_goal_prev_prev = string_null;
+               strfree(wcross_name_goal_prev);
+               strfree(wcross_name_goal_prev_prev);
                wcross_name_changestarttime = 0;
                wcross_name_changedonetime = 0;
                wcross_name_alpha_goal_prev = 0;
index 0da7afceb9806bae3c810aa2578c94bbf1e5b5d7,582a8d35bcb9cfcd42182f8064312ef4fd3dc449..dbdc793cf42528be56f4701955a3f5a8d7d45db7
@@@ -11,7 -11,7 +11,7 @@@ bool autocvar_g_overkill_itemwaypoints 
  
  .Weapon ok_lastwep[MAX_WEAPONSLOTS];
  
- REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
+ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !autocvar_g_instagib && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
  {
        MUTATOR_ONADD
        {
@@@ -37,9 -37,9 +37,9 @@@
                WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
                WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
  
 -              WEP_SHOTGUN.mdl = "ok_shotgun";
 -              WEP_MACHINEGUN.mdl = "ok_mg";
 -              WEP_VORTEX.mdl = "ok_sniper";
 +              //WEP_SHOTGUN.mdl = "ok_shotgun";
 +              //WEP_MACHINEGUN.mdl = "ok_mg";
 +              //WEP_VORTEX.mdl = "ok_sniper";
        }
  
        MUTATOR_ONREMOVE
@@@ -122,31 -122,32 +122,31 @@@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCur
  
  MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
  {
 -      if(game_stopped)
 +      if (game_stopped)
 +      {
                return;
 -
 +      }
        entity player = M_ARGV(0, entity);
 -
 -      if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player))
 +      if (!IS_PLAYER(player) || IS_DEAD(player) || STAT(FROZEN, player))
 +      {
                return;
 -
 -      if(PHYS_INPUT_BUTTON_ATCK2(player) && time >= player.jump_interval)
 -      if( !forbidWeaponUse(player)
 -              || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
 +      }
 +      if (!PHYS_INPUT_BUTTON_ATCK2(player) || forbidWeaponUse(player) ||
 +              !(round_handler_IsActive() && !round_handler_IsRoundStarted()))
        {
 -              player.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(player);
 -              makevectors(player.v_angle);
 -
 -              for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 +              return;
 +      }
 +      // Allow secondary blaster during countdown.
 +      for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 +      {
 +              .entity weaponentity = weaponentities[slot];
 +              Weapon weapon = player.(weaponentity).m_weapon;
 +              if (weapon == WEP_Null && slot != 0)
                {
 -                      .entity weaponentity = weaponentities[slot];
 -
 -                      if(player.(weaponentity).m_weapon == WEP_Null && slot != 0)
 -                              continue;
 -
 -                      BLASTER_SECONDARY_ATTACK(vaporizer, player, weaponentity);
 +                      continue;
                }
 +              weapon.wr_think(weapon, player, weaponentity, 2);
        }
 -
        PHYS_INPUT_BUTTON_ATCK2(player) = false;
  }
  
@@@ -168,9 -169,9 +168,9 @@@ MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSe
                {
                        Weapon newwep = player.ok_lastwep[slot];
                        if(player.ok_lastwep[slot] == WEP_HMG)
 -                              newwep = WEP_MACHINEGUN;
 +                              newwep = WEP_OVERKILL_MACHINEGUN;
                        if(player.ok_lastwep[slot] == WEP_RPC)
 -                              newwep = WEP_VORTEX;
 +                              newwep = WEP_OVERKILL_NEX;
                        thiswep.m_switchweapon = newwep;
                        player.ok_lastwep[slot] = WEP_Null;
                }
@@@ -257,7 -258,7 +257,7 @@@ MUTATOR_HOOKFUNCTION(ok, FilterItem
  
  MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
  {
 -      WepSet ok_start_items = (WEPSET(MACHINEGUN) | WEPSET(VORTEX) | WEPSET(SHOTGUN));
 +      WepSet ok_start_items = (WEPSET(OVERKILL_MACHINEGUN) | WEPSET(OVERKILL_NEX) | WEPSET(OVERKILL_SHOTGUN));
  
        if(WEP_RPC.weaponstart > 0) { ok_start_items |= WEPSET(RPC); }
        if(WEP_HMG.weaponstart > 0) { ok_start_items |= WEPSET(HMG); }
@@@ -287,4 -288,3 +287,4 @@@ MUTATOR_HOOKFUNCTION(ok, SetModname
        M_ARGV(0, string) = "Overkill";
        return true;
  }
 +
diff --combined qcsrc/server/client.qc
index 4d290e4be5127791fb742a4250f0211028c225ea,d374876d0456441bc59fdf69fe683a643bb8d42a..2db97ca7da1621e8bb35759efd9c6acc874cecc8
@@@ -62,8 -62,6 +62,8 @@@
  
  #include "../lib/warpzone/server.qh"
  
 +#include <common/mutators/mutator/overkill/oknex.qh>
 +
  STATIC_METHOD(Client, Add, void(Client this, int _team))
  {
      ClientConnect(this);
@@@ -1354,8 -1352,8 +1354,8 @@@ void ClientDisconnect(entity this
  
      MUTATOR_CALLHOOK(ClientDisconnect, this);
  
-       if (CS(this).netname_previous) strunzone(CS(this).netname_previous); // needs to be before the CS entity is removed!
-       if (CS(this).weaponorder_byimpulse) strunzone(CS(this).weaponorder_byimpulse);
+       strfree(CS(this).netname_previous); // needs to be before the CS entity is removed!
+       strfree(CS(this).weaponorder_byimpulse);
        ClientState_detach(this);
  
        Portal_ClearAll(this);
  
        bot_relinkplayerlist();
  
-       if (this.clientstatus) strunzone(this.clientstatus);
+       strfree(this.clientstatus);
        if (this.personal) delete(this.personal);
  
        this.playerid = 0;
@@@ -1498,7 -1496,7 +1498,7 @@@ void player_powerups(entity this
        Fire_ApplyDamage(this);
        Fire_ApplyEffect(this);
  
-       if (!g_instagib)
+       if (!autocvar_g_instagib)
        {
                if (this.items & ITEM_Strength.m_itemid)
                {
@@@ -2248,43 -2246,6 +2248,6 @@@ bool PlayerThink(entity this
                return false;
        }
  
-       bool have_hook = false;
-       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
-       {
-               .entity weaponentity = weaponentities[slot];
-               if(this.(weaponentity).hook.state)
-               {
-                       have_hook = true;
-                       break;
-               }
-       }
-       bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
-       if (have_hook) {
-               do_crouch = false;
-       //} else if (this.waterlevel >= WATERLEVEL_SWIMMING) {
-               //do_crouch = false;
-       } else if (this.vehicle) {
-               do_crouch = false;
-       } else if (STAT(FROZEN, this)) {
-               do_crouch = false;
-     }
-       if (do_crouch) {
-               if (!this.crouch) {
-                       this.crouch = true;
-                       this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this);
-                       setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
-                       // setanim(this, this.anim_duck, false, true, true); // this anim is BROKEN anyway
-               }
-       } else if (this.crouch) {
-         tracebox(this.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), this.origin, false, this);
-         if (!trace_startsolid) {
-             this.crouch = false;
-             this.view_ofs = STAT(PL_VIEW_OFS, this);
-             setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
-         }
-       }
        FixPlayermodel(this);
  
        if (this.shootfromfixedorigin != autocvar_g_shootfromfixedorigin) {
@@@ -2520,8 -2481,7 +2483,7 @@@ void PlayerPreThink (entity this
                }
                if (!assume_unchanged && autocvar_sv_eventlog)
                        GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false)));
-               if (CS(this).netname_previous) strunzone(CS(this).netname_previous);
-               CS(this).netname_previous = strzone(this.netname);
+               strcpy(CS(this).netname_previous, this.netname);
        }
  
        // version nagging
diff --combined qcsrc/server/defs.qh
index 865d7b2cbe875e462f6c7132d25e1198771e0e5d,e005d0ca844eca9c9bcbfd0b15db6dd27ad820d2..afe5814a516140630f3e9a1f60d39943e2e9b129
@@@ -7,7 -7,7 +7,7 @@@
  
  // Globals
  
- float g_footsteps, g_grappling_hook, g_instagib;
+ float g_footsteps, g_grappling_hook;
  float g_warmup_allguns;
  float g_warmup_allow_timeout;
  float warmup_stage;
@@@ -323,9 -323,6 +323,9 @@@ float client_cefc_accumulatortime
  .float vortex_charge;
  .float vortex_charge_rottime;
  .float vortex_chargepool_ammo;
 +.float oknex_charge;
 +.float oknex_charge_rottime;
 +.float oknex_chargepool_ammo;
  .int hagar_load;
  
  .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
diff --combined xonotic-server.cfg
index 6d53c9f9e01a4e41fe956017ae7b9a13f75baf4c,6a56fac3c26c2e002446c9465cd4c8fee4737cfd..e491d19475f159cbb71f1327bfb89d35b59c7dd3
@@@ -138,9 -138,9 +138,9 @@@ set bot_ai_keyboard_threshold 0.5
  set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim"
  set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming"
  set bot_ai_custom_weapon_priority_distances "300 850" "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
 -set bot_ai_custom_weapon_priority_far   "vaporizer vortex rifle electro devastator mortar hagar hlac crylink blaster machinegun fireball seeker shotgun shockwave tuba minelayer"     "Desired weapons for far distances ordered by priority"
 -set bot_ai_custom_weapon_priority_mid   "vaporizer devastator vortex fireball seeker mortar electro machinegun arc crylink hlac hagar shotgun shockwave blaster rifle tuba minelayer" "Desired weapons for middle distances ordered by priority"
 -set bot_ai_custom_weapon_priority_close "vaporizer vortex shotgun shockwave machinegun arc hlac tuba seeker hagar crylink mortar electro devastator blaster fireball rifle minelayer" "Desired weapons for close distances ordered by priority"
 +set bot_ai_custom_weapon_priority_far   "vaporizer oknex vortex rifle electro devastator mortar hagar hlac crylink blaster okmachinegun machinegun fireball seeker okshotgun shotgun shockwave tuba minelayer"        "Desired weapons for far distances ordered by priority"
 +set bot_ai_custom_weapon_priority_mid   "vaporizer devastator oknex vortex fireball seeker mortar electro okmachinegun machinegun arc crylink hlac hagar okshotgun shotgun shockwave blaster rifle tuba minelayer"    "Desired weapons for middle distances ordered by priority"
 +set bot_ai_custom_weapon_priority_close "vaporizer oknex vortex okshotgun shotgun shockwave okmachinegun machinegun arc hlac tuba seeker hagar crylink mortar electro devastator blaster fireball rifle minelayer"    "Desired weapons for close distances ordered by priority"
  set bot_ai_weapon_combo 1     "Enable bots to do weapon combos"
  set bot_ai_weapon_combo_threshold 0.4 "Try to make a combo N seconds after the last attack"
  set bot_ai_friends_aware_pickup_radius "500"  "Bots will not pickup items if a team mate is this distance near the item"
@@@ -179,7 -179,7 +179,7 @@@ set bot_vs_human 0 "Bots and humans pla
  
  set g_spawnshieldtime 1 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
  set g_spawnshield_blockdamage 1 "how much spawn shield protects you from damage (1 = full protection)"
- set g_antilag 2       "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
+ set g_antilag 2       "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past)"
  set g_antilag_nudge 0 "don't touch"
  set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2"
  set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2"