]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/vehicles
authorMario <zacjardine@y7mail.com>
Tue, 14 Apr 2015 23:00:35 +0000 (09:00 +1000)
committerMario <zacjardine@y7mail.com>
Tue, 14 Apr 2015 23:00:35 +0000 (09:00 +1000)
1  2 
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/server/command/cmd.qc
qcsrc/server/g_world.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_overkill.qc

diff --combined qcsrc/client/main.qc
index aa7a1836b913ae9538cdf6355dfb42277f5ac13f,36ec4f7b8c2525c2712566410ae80be9977ab50f..e0d8052a87fd6f9950c99e5f60dbadf4b9d4b679
@@@ -9,9 -9,9 +9,9 @@@
  #include "wall.qh"
  #include "waypointsprites.qh"
  
 -#include "vehicles/vehicles.qh"
 -
 -#include "../server/vehicles/bumblebee.qh"
 +#include "../common/vehicles/unit/bumblebee.qh"
 +#include "../common/vehicles/cl_vehicles.qh"
 +#include "../common/vehicles/vehicles.qh"
  
  #include "../common/net_notice.qh"
  
@@@ -108,7 -108,6 +108,7 @@@ void CSQC_Init(void
  
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
 +      CALL_ACCUMULATED_FUNCTION(RegisterVehicles);
        CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        Hook_Precache();
        GibSplash_Precache();
        Casings_Precache();
 -      Vehicles_Precache();
        turrets_precache();
        Tuba_Precache();
        CSQCPlayer_Precache();
        WarpZone_Init();
  
        hud_skin_path = strzone(strcat("gfx/hud/", autocvar_hud_skin));
-       hud_configure_prev = -1;
        draw_currentSkin = strzone(strcat("gfx/menu/", cvar_string("menu_skin")));
  }
  
diff --combined qcsrc/client/view.qc
index 4947e9d5c6648a165a5493a58c6bbef48f1a4e2c,26e709320778a9892ae0493a7452d3a8d5d28257..6eac9dac52370d7f8d89b0a9105cf7cd75d6693a
@@@ -390,6 -390,8 +390,6 @@@ const float CAMERA_CHASE = 2
  float reticle_type;
  string reticle_image;
  string NextFrameCommand;
 -void CSQC_SPIDER_HUD();
 -void CSQC_RAPTOR_HUD();
  
  vector freeze_org, freeze_ang;
  entity nightvision_noise, nightvision_noise2;
@@@ -761,7 -763,7 +761,7 @@@ void UpdateCrosshair(
                wcross_alpha_goal_prev = wcross_alpha;
                wcross_color_goal_prev = wcross_color;
  
-               if(shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))
+               if(spectatee_status == -1 && shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))
                {
                        wcross_blur = 1;
                        wcross_alpha *= 0.75;
@@@ -1774,10 -1776,18 +1774,10 @@@ void CSQC_UpdateView(float w, float h
                HUD_Panel_Mouse();
  
      if(hud && !intermission)
 -    {
 -        if(hud == HUD_SPIDERBOT)
 -            CSQC_SPIDER_HUD();
 -        else if(hud == HUD_WAKIZASHI)
 -            CSQC_WAKIZASHI_HUD();
 -        else if(hud == HUD_RAPTOR)
 -            CSQC_RAPTOR_HUD();
 -        else if(hud == HUD_BUMBLEBEE)
 -            CSQC_BUMBLE_HUD();
 -        else if(hud == HUD_BUMBLEBEE_GUN)
 -            CSQC_BUMBLE_GUN_HUD();
 -    }
 +    if(hud == HUD_BUMBLEBEE_GUN)
 +      CSQC_BUMBLE_GUN_HUD();
 +    else
 +              VEH_ACTION(hud, VR_HUD);
  
        cl_notice_run();
  
index d4f2a01754d6d637f8c1eae254b1a8220f3a2fc9,14e0f201c0f7bb029d4f4363a8ba50e7b7ea39c3..e9c3af16af4d83af980e1112c8a157481602f710
@@@ -16,7 -16,7 +16,7 @@@
      #include "../../common/notifications.qh"
      #include "../../common/deathtypes.qh"
      #include "../mutators/mutators_include.qh"
 -    #include "../vehicles/vehicles_def.qh"
 +    #include "../../common/vehicles/sv_vehicles.qh"
      #include "../campaign.qh"
      #include "../../common/mapinfo.qh"
      #include "common.qh"
@@@ -825,6 -825,15 +825,15 @@@ void ClientCommand_macro_write_aliases(
  
  void SV_ParseClientCommand(string command)
  {
+       // If invalid UTF-8, don't even parse it
+       string command2 = "";
+       float len = strlen(command);
+       float i;
+       for (i = 0; i < len; ++i)
+               command2 = strcat(command2, chr2str(str2chr(command, i)));
+       if (command != command2)
+               return;
        // if we're banned, don't even parse the command
        if(Ban_MaybeEnforceBanOnce(self))
                return;
diff --combined qcsrc/server/g_world.qc
index 5c34419ca77b6c18523660f598329c091e1b200e,04f8ff7b38afbf7551a2a162bf1153acc043c6cd..ecc3005a335a22469769bc8c2e9668ac5b64eaa0
@@@ -10,7 -10,6 +10,7 @@@
      #include "../common/teams.qh"
      #include "../common/util.qh"
      #include "../common/monsters/sv_monsters.qh"
 +    #include "../common/vehicles/vehicles.qh"
      #include "../common/weapons/weapons.qh"
      #include "weapons/weaponstats.qh"
      #include "autocvars.qh"
@@@ -315,15 -314,21 +315,21 @@@ void cvar_changes_init(
                // does nothing visible
                BADCVAR("captureleadlimit_override");
                BADCVAR("g_balance_kill_delay");
+               BADCVAR("g_ca_point_limit");
                BADCVAR("g_ca_point_leadlimit");
                BADCVAR("g_ctf_captimerecord_always");
                BADCVAR("g_ctf_flag_glowtrails");
                BADCVAR("g_ctf_flag_pickup_verbosename");
                BADCVAR("g_domination_point_leadlimit");
                BADCVAR("g_forced_respawn");
+               BADCVAR("g_freezetag_point_limit");
+               BADCVAR("g_freezetag_point_leadlimit");
                BADCVAR("g_keyhunt_point_leadlimit");
                BADPREFIX("g_mod_");
+               BADCVAR("g_invasion_point_limit");
                BADCVAR("g_nexball_goalleadlimit");
+               BADCVAR("g_tdm_point_limit");
+               BADCVAR("g_tdm_point_leadlimit");
                BADCVAR("leadlimit_and_fraglimit");
                BADCVAR("leadlimit_override");
                BADCVAR("pausable");
@@@ -553,7 -558,6 +559,7 @@@ void spawnfunc___init_dedicated_server(
  
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
 +      CALL_ACCUMULATED_FUNCTION(RegisterVehicles);
        CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
@@@ -602,7 -606,6 +608,7 @@@ void spawnfunc_worldspawn (void
  
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
 +      CALL_ACCUMULATED_FUNCTION(RegisterVehicles);
        CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
index 10f1aec26b951669e6768f06556e3580f46ee181,60b2acce56053ea2b1d2ab295b393c99737a0df6..4e91fb2e5e628d41f12076d83aaf2184df47c826
@@@ -551,12 -551,12 +551,12 @@@ void nade_boom(
  
  void nade_touch()
  {
-       float is_weapclip = 0;
+       /*float is_weapclip = 0;
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
        if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
        if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
-               is_weapclip = 1;
-       if(ITEM_TOUCH_NEEDKILL() || is_weapclip)
+               is_weapclip = 1;*/
+       if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip)
        {
                remove(self);
                return;
@@@ -666,7 -666,13 +666,13 @@@ void toss_nade(entity e, vector _veloci
  
        Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES);
  
-       setorigin(_nade, w_shotorg + (v_right * 25) * -1);
+       vector offset = (v_forward * autocvar_g_nades_throw_offset.x)
+                                 + (v_right * autocvar_g_nades_throw_offset.y)
+                                 + (v_up * autocvar_g_nades_throw_offset.z);
+       if(autocvar_g_nades_throw_offset == '0 0 0')
+               offset = '0 0 0';
+       setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
        //setmodel(_nade, "models/weapons/v_ok_grenade.md3");
        //setattachment(_nade, world, "");
        PROJECTILE_MAKETRIGGER(_nade);
        if (trace_startsolid)
                setorigin(_nade, e.origin);
  
-       if(self.v_angle.x >= 70 && self.v_angle.x <= 110)
+       if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && self.BUTTON_CROUCH)
                _nade.velocity = '0 0 100';
        else if(autocvar_g_nades_nade_newton_style == 1)
                _nade.velocity = e.velocity + _velocity;
@@@ -842,7 -848,7 +848,7 @@@ float CanThrowNade(
        if (!autocvar_g_nades)
                return false; // allow turning them off mid match
  
 -      if(forbidWeaponUse())
 +      if(forbidWeaponUse(self))
                return false;
  
        if (!IS_PLAYER(self))
index df9e37aa68761a165d2e2e4df3748eeba86bea5c,78a61510602787209533b227e909982e2d63d304..8441c49bb92765fb7452c11b19049056c4833a16
@@@ -64,6 -64,7 +64,7 @@@ MUTATOR_HOOKFUNCTION(ok_PlayerDamage_Sp
  MUTATOR_HOOKFUNCTION(ok_PlayerDies)
  {
        entity oldself = self;
+       entity targ = ((frag_attacker) ? frag_attacker : frag_target);
  
        if(self.flags & FL_MONSTER)
        {
@@@ -80,7 -81,7 +81,7 @@@
        self.gravity = 1;
        self.reset = SUB_Remove;
        setorigin(self, frag_target.origin + '0 0 32');
-       self.velocity = '0 0 200' + normalize(frag_attacker.origin - self.origin) * 500;
+       self.velocity = '0 0 200' + normalize(targ.origin - self.origin) * 500;
        self.classname = "droppedweapon"; // hax
        SUB_SetFade(self, time + 5, 1);
        self = oldself;
@@@ -131,12 -132,14 +132,14 @@@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink
        ok_IncreaseCharge(self, self.weapon);
  
        if(self.BUTTON_ATCK2)
 -      if(!forbidWeaponUse() || self.weapon_blocked) // allow if weapon is blocked
 +      if(!forbidWeaponUse(self) || self.weapon_blocked) // allow if weapon is blocked
        if(time >= self.jump_interval)
        {
                self.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor();
                makevectors(self.v_angle);
  
+               int oldwep = self.weapon;
+               self.weapon = WEP_BLASTER;
                W_Blaster_Attack(
                        WEP_BLASTER | HITTYPE_SECONDARY,
                        WEP_CVAR_SEC(vaporizer, shotangle),
                        WEP_CVAR_SEC(vaporizer, delay),
                        WEP_CVAR_SEC(vaporizer, lifetime)
                );
+               self.weapon = oldwep;
        }
  
        self.weapon_blocked = false;