]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'proraide/fix_fps' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 28 Feb 2016 05:04:32 +0000 (05:04 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 28 Feb 2016 05:04:32 +0000 (05:04 +0000)
Regain ~10 fps

commit 5a935f5c767deb9151a2e7b4f2bc190766190ab7 moved drawfill() after
if()

as far as I can tell it's unnecessary and putting it back into if-else
restores 10 fps in my tests

See merge request !287

46 files changed:
.gitlab-ci.yml
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
defaultXonotic.cfg
models/weapons/g_campingrifle.md3
models/weapons/g_hagar.md3
models/weapons/h_hagar.iqm
models/weapons/h_hagar.iqm.framegroups
models/weapons/v_campingrifle.md3
models/weapons/v_hagar.md3
monsters.cfg
mutators.cfg
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/effects/qc/globalsound.qh
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/physics/player.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/all.qc
qcsrc/server/autocvars.qh
qcsrc/server/weapons/weaponsystem.qc
scripts/weapons.shader
textures/campingrifle.tga [deleted file]
textures/campingrifle_bump.tga [deleted file]
textures/campingrifle_gloss.tga [deleted file]
textures/campingrifle_glow.tga [deleted file]
textures/campingrifle_screen.tga [deleted file]
textures/hagar.tga [new file with mode: 0644]
textures/hagar2.tga [deleted file]
textures/hagar2_gloss.tga [deleted file]
textures/hagar2_glow.tga [deleted file]
textures/hagar2_norm.tga [deleted file]
textures/hagar2_reflect.tga [deleted file]
textures/hagar2_shirt.tga [deleted file]
textures/hagar_glow.tga [new file with mode: 0644]
textures/hagar_norm.tga [new file with mode: 0644]
textures/hagar_reflect.tga [new file with mode: 0644]
textures/hagar_shirt.tga [new file with mode: 0644]
textures/hagar_spec.tga [new file with mode: 0644]
textures/sniperrifle.tga [new file with mode: 0644]
textures/sniperrifle_bump.tga [new file with mode: 0644]
textures/sniperrifle_glow.tga [new file with mode: 0644]
textures/sniperrifle_reflect.tga [new file with mode: 0644]

index 2915488002a75da38e59c7018da6a869abe5871d..613f231ea641a29394286dc877c57edadc99401e 100644 (file)
@@ -27,7 +27,7 @@ test_sv_game:
   script:
     - wget -O data/g-23.pk3 http://beta.xonotic.org/autobuild-bsp/latest/g-23.pk3
     - make
-    - EXPECT=4c308ac459a47a3641c8a1934d13667c
+    - EXPECT=f75e1bf926a9d7bfe27765f5cf8cef20
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 07005ccc3f2e8fba8c3eaf6a6ce7f3f5f77b2a1e..7cb9d9f4c9b29c5b58ec430244227574d91b19c8 100644 (file)
@@ -219,7 +219,7 @@ set g_balance_electro_secondary_speed 1000
 set g_balance_electro_secondary_speed_up 200
 set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0.04
-set g_balance_electro_secondary_touchexplode 0
+set g_balance_electro_secondary_touchexplode 1
 set g_balance_electro_switchdelay_drop 0.2
 set g_balance_electro_switchdelay_raise 0.2
 set g_balance_electro_weaponreplace ""
@@ -242,7 +242,7 @@ set g_balance_crylink_primary_joinexplode_edgedamage 0
 set g_balance_crylink_primary_joinexplode_force 0
 set g_balance_crylink_primary_joinexplode_radius 0
 set g_balance_crylink_primary_joinspread 0.2
-set g_balance_crylink_primary_linkexplode 1
+set g_balance_crylink_primary_linkexplode 0
 set g_balance_crylink_primary_middle_fadetime 5
 set g_balance_crylink_primary_middle_lifetime 5
 set g_balance_crylink_primary_other_fadetime 5
@@ -725,7 +725,7 @@ set g_balance_shockwave_weaponstartoverride -1
 set g_balance_shockwave_weaponthrowable 0
 // }}}
 // {{{ #20: Arc
-set g_balance_arc_beam_ammo 4
+set g_balance_arc_beam_ammo 6
 set g_balance_arc_beam_animtime 0.2
 set g_balance_arc_beam_botaimlifetime 0
 set g_balance_arc_beam_botaimspeed 0
@@ -736,20 +736,20 @@ set g_balance_arc_beam_falloff_halflifedist 0
 set g_balance_arc_beam_falloff_maxdist 0
 set g_balance_arc_beam_falloff_mindist 0
 set g_balance_arc_beam_force 900
-set g_balance_arc_beam_healing_amax 100
+set g_balance_arc_beam_healing_amax 0
 set g_balance_arc_beam_healing_aps 50
 set g_balance_arc_beam_healing_hmax 150
 set g_balance_arc_beam_healing_hps 50
 set g_balance_arc_cooldown 2.5
-set g_balance_arc_cooldown_release 1
+set g_balance_arc_cooldown_release 0
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
-set g_balance_arc_beam_heat 1
+set g_balance_arc_beam_heat 0.75
 set g_balance_arc_burst_heat 4
 set g_balance_arc_beam_maxangle 10
 set g_balance_arc_beam_nonplayerdamage 80
 set g_balance_arc_beam_range 1000
-set g_balance_arc_beam_refire 0.5
+set g_balance_arc_beam_refire 0.25
 set g_balance_arc_beam_returnspeed 8
 set g_balance_arc_beam_tightness 0.5
 set g_balance_arc_bolt 0
@@ -757,19 +757,19 @@ set g_balance_arc_bolt_ammo 1
 set g_balance_arc_bolt_damage 25
 set g_balance_arc_bolt_damageforcescale 0
 set g_balance_arc_bolt_edgedamage 12.5
-set g_balance_arc_bolt_force 100
+set g_balance_arc_bolt_force 120
 set g_balance_arc_bolt_health 15
 set g_balance_arc_bolt_lifetime 5
 set g_balance_arc_bolt_radius 65
 set g_balance_arc_bolt_refire 0.16667
 set g_balance_arc_bolt_speed 2200
-set g_balance_arc_bolt_spread 0.03
+set g_balance_arc_bolt_spread 0
 set g_balance_arc_burst_ammo 15
 set g_balance_arc_burst_damage 250
 set g_balance_arc_burst_healing_aps 100
 set g_balance_arc_burst_healing_hps 100
-set g_balance_arc_switchdelay_drop 0.3
-set g_balance_arc_switchdelay_raise 0.3
+set g_balance_arc_switchdelay_drop 0.2
+set g_balance_arc_switchdelay_raise 0.2
 set g_balance_arc_weaponreplace ""
 set g_balance_arc_weaponstart 0
 set g_balance_arc_weaponstartoverride -1
index 07005ccc3f2e8fba8c3eaf6a6ce7f3f5f77b2a1e..7cb9d9f4c9b29c5b58ec430244227574d91b19c8 100644 (file)
@@ -219,7 +219,7 @@ set g_balance_electro_secondary_speed 1000
 set g_balance_electro_secondary_speed_up 200
 set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0.04
-set g_balance_electro_secondary_touchexplode 0
+set g_balance_electro_secondary_touchexplode 1
 set g_balance_electro_switchdelay_drop 0.2
 set g_balance_electro_switchdelay_raise 0.2
 set g_balance_electro_weaponreplace ""
@@ -242,7 +242,7 @@ set g_balance_crylink_primary_joinexplode_edgedamage 0
 set g_balance_crylink_primary_joinexplode_force 0
 set g_balance_crylink_primary_joinexplode_radius 0
 set g_balance_crylink_primary_joinspread 0.2
-set g_balance_crylink_primary_linkexplode 1
+set g_balance_crylink_primary_linkexplode 0
 set g_balance_crylink_primary_middle_fadetime 5
 set g_balance_crylink_primary_middle_lifetime 5
 set g_balance_crylink_primary_other_fadetime 5
@@ -725,7 +725,7 @@ set g_balance_shockwave_weaponstartoverride -1
 set g_balance_shockwave_weaponthrowable 0
 // }}}
 // {{{ #20: Arc
-set g_balance_arc_beam_ammo 4
+set g_balance_arc_beam_ammo 6
 set g_balance_arc_beam_animtime 0.2
 set g_balance_arc_beam_botaimlifetime 0
 set g_balance_arc_beam_botaimspeed 0
@@ -736,20 +736,20 @@ set g_balance_arc_beam_falloff_halflifedist 0
 set g_balance_arc_beam_falloff_maxdist 0
 set g_balance_arc_beam_falloff_mindist 0
 set g_balance_arc_beam_force 900
-set g_balance_arc_beam_healing_amax 100
+set g_balance_arc_beam_healing_amax 0
 set g_balance_arc_beam_healing_aps 50
 set g_balance_arc_beam_healing_hmax 150
 set g_balance_arc_beam_healing_hps 50
 set g_balance_arc_cooldown 2.5
-set g_balance_arc_cooldown_release 1
+set g_balance_arc_cooldown_release 0
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
-set g_balance_arc_beam_heat 1
+set g_balance_arc_beam_heat 0.75
 set g_balance_arc_burst_heat 4
 set g_balance_arc_beam_maxangle 10
 set g_balance_arc_beam_nonplayerdamage 80
 set g_balance_arc_beam_range 1000
-set g_balance_arc_beam_refire 0.5
+set g_balance_arc_beam_refire 0.25
 set g_balance_arc_beam_returnspeed 8
 set g_balance_arc_beam_tightness 0.5
 set g_balance_arc_bolt 0
@@ -757,19 +757,19 @@ set g_balance_arc_bolt_ammo 1
 set g_balance_arc_bolt_damage 25
 set g_balance_arc_bolt_damageforcescale 0
 set g_balance_arc_bolt_edgedamage 12.5
-set g_balance_arc_bolt_force 100
+set g_balance_arc_bolt_force 120
 set g_balance_arc_bolt_health 15
 set g_balance_arc_bolt_lifetime 5
 set g_balance_arc_bolt_radius 65
 set g_balance_arc_bolt_refire 0.16667
 set g_balance_arc_bolt_speed 2200
-set g_balance_arc_bolt_spread 0.03
+set g_balance_arc_bolt_spread 0
 set g_balance_arc_burst_ammo 15
 set g_balance_arc_burst_damage 250
 set g_balance_arc_burst_healing_aps 100
 set g_balance_arc_burst_healing_hps 100
-set g_balance_arc_switchdelay_drop 0.3
-set g_balance_arc_switchdelay_raise 0.3
+set g_balance_arc_switchdelay_drop 0.2
+set g_balance_arc_switchdelay_raise 0.2
 set g_balance_arc_weaponreplace ""
 set g_balance_arc_weaponstart 0
 set g_balance_arc_weaponstartoverride -1
index 7bc9466eb45bdec8b53dd4d28bd559d8927d8e51..50e0ad7e724bcf15dc9466f4940d0e08563a1a9a 100644 (file)
@@ -163,28 +163,21 @@ cl_bobmodel 1 // whether to have gun model move around on screen when moving (on
 cl_bobmodel_side 0.2 // amount the gun sways to the sides
 cl_bobmodel_speed 5 // rate at which the gun sways
 cl_bobmodel_up 0.1 // amount the gun sways up and down
-cl_leanmodel 1 // enables weapon leaning effect when looking around
-cl_leanmodel_side_speed 0.7 "gun leaning sideways speed"
-cl_leanmodel_side_limit 35 "gun leaning sideways limit"
-cl_leanmodel_side_highpass1 30 "gun leaning sideways pre-highpass in 1/s"
-cl_leanmodel_side_highpass 3 "gun leaning sideways highpass in 1/s"
-cl_leanmodel_side_lowpass 20 "gun leaning sideways lowpass in 1/s"
-cl_leanmodel_up_speed 0.65 "gun leaning upward speed"
-cl_leanmodel_up_limit 50 "gun leaning upward limit"
-cl_leanmodel_up_highpass1 5 "gun leaning upward pre-highpass in 1/s"
-cl_leanmodel_up_highpass 15 "gun leaning upward highpass in 1/s"
-cl_leanmodel_up_lowpass 20 "gun leaning upward lowpass in 1/s"
+
 cl_followmodel 1 // enables weapon pushing / pulling effect when walking
-cl_followmodel_side_speed 0.25 "gun following sideways speed"
-cl_followmodel_side_limit 6 "gun following sideways limit"
-cl_followmodel_side_highpass1 30 "gun following sideways pre-highpass in 1/s"
-cl_followmodel_side_highpass 5 "gun following sideways highpass in 1/s"
-cl_followmodel_side_lowpass 10 "gun following sideways lowpass in 1/s"
-cl_followmodel_up_speed 0.5 "gun following upward speed"
-cl_followmodel_up_limit 5 "gun following upward limit"
-cl_followmodel_up_highpass1 60 "gun following upward pre-highpass in 1/s"
-cl_followmodel_up_highpass 2 "gun following upward highpass in 1/s"
-cl_followmodel_up_lowpass 10 "gun following upward lowpass in 1/s"
+seta cl_followmodel_speed 0.3 "gun following speed"
+seta cl_followmodel_limit 1000 "gun following limit"
+seta cl_followmodel_velocity_absolute 0 "make the effect ignore velocity direction changes (side effect: it causes a glitch when teleporting / passing through a warpzone)"
+seta cl_followmodel_velocity_lowpass 0.05 "gun following velocity lowpass averaging time"
+seta cl_followmodel_highpass 0.05 "gun following highpass averaging time"
+seta cl_followmodel_lowpass 0.03 "gun following lowpass averaging time"
+
+cl_leanmodel 1 // enables weapon leaning effect when looking around
+seta cl_leanmodel_speed 0.3 "gun leaning speed"
+seta cl_leanmodel_limit 1000 "gun leaning limit"
+seta cl_leanmodel_highpass1 0.2 "gun leaning pre-highpass averaging time"
+seta cl_leanmodel_highpass 0.2 "gun leaning highpass averaging time"
+seta cl_leanmodel_lowpass 0.05 "gun leaning lowpass averaging time"
 
 cl_rollangle 0 // amount of view tilt when strafing, default is 2.0
 v_kicktime 0 // how long damage kicks of the view last, default is 0 seconds
index 594e706f816163407b4e8e3324ca9963a4705f15..fd829833e283f41c4276b116966ec33f55116207 100644 (file)
Binary files a/models/weapons/g_campingrifle.md3 and b/models/weapons/g_campingrifle.md3 differ
index 6e21ba9f83a4d578b2b8454aacff8f9aeb3d6c73..2047627bf65db56cac69da5050a85deb20800edf 100644 (file)
Binary files a/models/weapons/g_hagar.md3 and b/models/weapons/g_hagar.md3 differ
index a51c6c4f5ed4238b772ffa4853ae24127aa9aeaf..fe87dac0304abecf381443d8a506c743948977a1 100644 (file)
Binary files a/models/weapons/h_hagar.iqm and b/models/weapons/h_hagar.iqm differ
index 0a59625b6a6aa297525c008a66ba879537a5ac08..e02cf0f641f77d9e1a8e8a2d937e87e8e2e9377a 100644 (file)
@@ -1,4 +1,9 @@
-1 8 20 0 // fire
-9 5 20 0 // fire2
-15 200 20 1 // idle
-215 40 20 0 // reload
+/*
+Generated framegroups file for h_hagar
+Used by DarkPlaces to simulate frame groups in DPM models.
+*/
+
+1 11 15 1 // h_hagar fire
+12 9 60 1 // h_hagar fire2
+21 51 5 1 // h_hagar idle
+72 21 30 1 // h_hagar reload
index 251e79f75cf7390d99a516981b7cf14de58fc58b..e9990ebc320bcd84302633c7db9f08a9bd757532 100644 (file)
Binary files a/models/weapons/v_campingrifle.md3 and b/models/weapons/v_campingrifle.md3 differ
index 19a245343322da6aa2dbfbb7de9b9a96c63264cf..f1f08b0108f984ae73ea0cb9e11bffa012e1dff6 100644 (file)
Binary files a/models/weapons/v_hagar.md3 and b/models/weapons/v_hagar.md3 differ
index 2cb6c3e7d90431937bab6a1246f001f40b05e2e6..f6eca00d004e4196ffff60499b30a5ab44bed257 100644 (file)
@@ -20,7 +20,7 @@ set g_monster_spider_attack_web_speed 1300
 set g_monster_spider_attack_web_speed_up 150
 set g_monster_spider_damageforcescale 0.600000024
 set g_monster_spider_health 180
-set g_monster_spider_speed_run 750
+set g_monster_spider_speed_run 500
 set g_monster_spider_speed_stop 100
 set g_monster_spider_speed_walk 400
 // }}}
index dd8d96a5670fbd35ac9ddd0a7d6a10af5a497f12..894caec140649a58e163b7bc431af0bd93b40ee5 100644 (file)
@@ -182,6 +182,8 @@ set g_nades 0 "enable off-hand grenades"
 set g_nades_throw_offset "0 0 0" "nade throwing offset"
 set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire"
 set g_nades_client_select 0 "allow client side selection of nade type"
+set g_nades_pickup 1 "allow picking up thrown nades (not your own)"
+set g_nades_pickup_time 2 "time until picked up nade explodes"
 set g_nades_nade_lifetime 3.5
 set g_nades_nade_minforce 400
 set g_nades_nade_maxforce 2000
@@ -214,6 +216,7 @@ set g_nades_bonus_type 2 "Type of the bonus grenade. 1:normal 2:napalm 3:ice 4:t
 set g_nades_bonus_onstrength 1 "Always give bonus grenades to players that have the strength powerup"
 set g_nades_bonus_max 3 "Maximum number of bonus grenades"
 set g_nades_bonus_only 0 "Disallow regular nades, only bonus nades can be used"
+set g_nades_nade_small 0 "Use smaller nade size, makes shooting them harder, legacy setting"
 // Bonus score
 set g_nades_bonus_score_max   120 "Score value that will give a bonus nade"
 set g_nades_bonus_score_minor   5 "Score given for minor actions (pickups, regular frags etc.)"
index aa490aa505c21e8c38fc46c52f0813da9b266ed8..14279816efdee0f62642a3cfe2fb0fb370fad76b 100644 (file)
@@ -202,6 +202,8 @@ void Shutdown()
        if(autocvar_chase_active < 0)
                cvar_set("chase_active", "0");
 
+       cvar_set("slowmo", cvar_defstring("slowmo")); // reset it back to 'default'
+
        if (!isdemo())
        {
                if (!(calledhooks & HOOK_START))
index b6b5c9cd075d5bdbe51134a4e892b775ef2c1996..d7207fc6f833aa71d2bcf5680a7736d55b26ea3e 100644 (file)
@@ -39,33 +39,23 @@ float autocvar_cl_bobmodel_side;
 float autocvar_cl_bobmodel_up;
 
 float autocvar_cl_followmodel;
-float autocvar_cl_followmodel_side_speed;
-float autocvar_cl_followmodel_side_highpass;
-float autocvar_cl_followmodel_side_highpass1;
-float autocvar_cl_followmodel_side_limit;
-float autocvar_cl_followmodel_side_lowpass;
-float autocvar_cl_followmodel_up_speed;
-float autocvar_cl_followmodel_up_highpass;
-float autocvar_cl_followmodel_up_highpass1;
-float autocvar_cl_followmodel_up_limit;
-float autocvar_cl_followmodel_up_lowpass;
+float autocvar_cl_followmodel_speed = 0.3;
+float autocvar_cl_followmodel_limit = 1000;
+float autocvar_cl_followmodel_velocity_lowpass = 0.05;
+float autocvar_cl_followmodel_highpass = 0.05;
+float autocvar_cl_followmodel_lowpass = 0.03;
 
 float autocvar_cl_leanmodel;
-float autocvar_cl_leanmodel_side_speed;
-float autocvar_cl_leanmodel_side_highpass;
-float autocvar_cl_leanmodel_side_highpass1;
-float autocvar_cl_leanmodel_side_lowpass;
-float autocvar_cl_leanmodel_side_limit;
-float autocvar_cl_leanmodel_up_speed;
-float autocvar_cl_leanmodel_up_highpass;
-float autocvar_cl_leanmodel_up_highpass1;
-float autocvar_cl_leanmodel_up_lowpass;
-float autocvar_cl_leanmodel_up_limit;
+float autocvar_cl_leanmodel_speed = 0.3;
+float autocvar_cl_leanmodel_limit = 1000;
+float autocvar_cl_leanmodel_highpass1 = 0.2;
+float autocvar_cl_leanmodel_highpass = 0.2;
+float autocvar_cl_leanmodel_lowpass = 0.05;
 
+#define avg_factor(avg_time) (1 - exp(-frametime / max(0.001, avg_time)))
 #define lowpass(value, frac, ref_store, ret) MACRO_BEGIN \
 { \
-       float __frac = bound(0, frac, 1); \
-       ret = ref_store = ref_store * (1 - __frac) + (value) * __frac; \
+       ret = ref_store = ref_store * (1 - frac) + (value) * frac; \
 } MACRO_END
 
 #define lowpass_limited(value, frac, limit, ref_store, ret) MACRO_BEGIN \
@@ -86,31 +76,63 @@ float autocvar_cl_leanmodel_up_limit;
        ret = (value) - __f; \
 } MACRO_END
 
-#define lowpass3(value, fracx, fracy, fracz, ref_store, ref_out) MACRO_BEGIN \
+#define lowpass2(value, frac, ref_store, ref_out) MACRO_BEGIN \
 { \
-       lowpass(value.x, fracx, ref_store.x, ref_out.x); \
-       lowpass(value.y, fracy, ref_store.y, ref_out.y); \
-       lowpass(value.z, fracz, ref_store.z, ref_out.z); \
+       lowpass(value.x, frac, ref_store.x, ref_out.x); \
+       lowpass(value.y, frac, ref_store.y, ref_out.y); \
 } MACRO_END
 
-#define highpass3(value, fracx, fracy, fracz, ref_store, ref_out) MACRO_BEGIN \
+#define lowpass2_limited(value, frac, limit, ref_store, ref_out) MACRO_BEGIN \
 { \
-       highpass(value.x, fracx, ref_store.x, ref_out.x); \
-       highpass(value.y, fracy, ref_store.y, ref_out.y); \
-       highpass(value.z, fracz, ref_store.z, ref_out.z); \
+       lowpass_limited(value.x, frac, limit, ref_store.x, ref_out.x); \
+       lowpass_limited(value.y, frac, limit, ref_store.y, ref_out.y); \
 } MACRO_END
 
-#define highpass3_limited(value, fracx, limitx, fracy, limity, fracz, limitz, ref_store, ref_out) MACRO_BEGIN \
+#define highpass2(value, frac, ref_store, ref_out) MACRO_BEGIN \
 { \
-       highpass_limited(value.x, fracx, limitx, ref_store.x, ref_out.x); \
-       highpass_limited(value.y, fracy, limity, ref_store.y, ref_out.y); \
-       highpass_limited(value.z, fracz, limitz, ref_store.z, ref_out.z); \
+       highpass(value.x, frac, ref_store.x, ref_out.x); \
+       highpass(value.y, frac, ref_store.y, ref_out.y); \
 } MACRO_END
 
+#define highpass2_limited(value, frac, limit, ref_store, ref_out) MACRO_BEGIN \
+{ \
+       highpass_limited(value.x, frac, limit, ref_store.x, ref_out.x); \
+       highpass_limited(value.y, frac, limit, ref_store.y, ref_out.y); \
+} MACRO_END
+
+#define lowpass3(value, frac, ref_store, ref_out) MACRO_BEGIN \
+{ \
+       lowpass(value.x, frac, ref_store.x, ref_out.x); \
+       lowpass(value.y, frac, ref_store.y, ref_out.y); \
+       lowpass(value.z, frac, ref_store.z, ref_out.z); \
+} MACRO_END
+
+#define highpass3(value, frac, ref_store, ref_out) MACRO_BEGIN \
+{ \
+       highpass(value.x, frac, ref_store.x, ref_out.x); \
+       highpass(value.y, frac, ref_store.y, ref_out.y); \
+       highpass(value.z, frac, ref_store.z, ref_out.z); \
+} MACRO_END
+
+#define highpass3_limited(value, frac, limit, ref_store, ref_out) MACRO_BEGIN \
+{ \
+       highpass_limited(value.x, frac, limit, ref_store.x, ref_out.x); \
+       highpass_limited(value.y, frac, limit, ref_store.y, ref_out.y); \
+       highpass_limited(value.z, frac, limit, ref_store.z, ref_out.z); \
+} MACRO_END
+
+#define lowpass3_limited(value, frac, limit, ref_store, ref_out) MACRO_BEGIN \
+{ \
+       lowpass_limited(value.x, frac, limit, ref_store.x, ref_out.x); \
+       lowpass_limited(value.y, frac, limit, ref_store.y, ref_out.y); \
+       lowpass_limited(value.z, frac, limit, ref_store.z, ref_out.z); \
+} MACRO_END
+
+bool autocvar_cl_followmodel_velocity_absolute;
 void viewmodel_animate(entity this)
 {
        static float prevtime;
-       float frametime = (time - prevtime) * STAT(MOVEVARS_TIMESCALE);
+       float frametime = (time - prevtime);
        prevtime = time;
 
        if (autocvar_chase_active) return;
@@ -131,84 +153,90 @@ void viewmodel_animate(entity this)
        }
        oldonground = clonground;
 
-       vector gunorg = '0 0 0', gunangles = '0 0 0';
-       static vector gunorg_prev = '0 0 0', gunangles_prev = '0 0 0';
 
        bool teleported = view.csqcmodel_teleported;
 
-       // 1. if we teleported, clear the frametime... the lowpass will recover the previous value then
-       if (teleported)
+       float frac;
+       if(autocvar_cl_followmodel)
        {
-               // try to fix the first highpass; result is NOT
-               // perfect! TODO find a better fix
+               vector gunorg = '0 0 0';
+               static vector vel_average;
+               static vector gunorg_prev = '0 0 0';
+               static vector gunorg_adjustment_highpass;
+               static vector gunorg_adjustment_lowpass;
+
+               vector vel;
+               if(autocvar_cl_followmodel_velocity_absolute)
+                       vel = view.velocity;
+               else
+               {
+                       vector forward, right = '0 0 0', up = '0 0 0';
+                       MAKEVECTORS(makevectors, view_angles, forward, right, up);
+                       vel.x = view.velocity * forward;
+                       vel.y = view.velocity * right * -1;
+                       vel.z = view.velocity * up;
+               }
+
+               frac = avg_factor(autocvar_cl_followmodel_velocity_lowpass);
+               lowpass3_limited(vel, frac, autocvar_cl_followmodel_limit, vel_average, gunorg);
+
+               gunorg *= -autocvar_cl_followmodel_speed * 0.042;
+
+               // perform highpass/lowpass on the adjustment vectors (turning velocity into acceleration!)
+               // trick: we must do the lowpass LAST, so the lowpass vector IS the final vector!
+               frac = avg_factor(autocvar_cl_followmodel_highpass);
+               highpass3(gunorg, frac, gunorg_adjustment_highpass, gunorg);
+               frac = avg_factor(autocvar_cl_followmodel_lowpass);
+               lowpass3(gunorg, frac, gunorg_adjustment_lowpass, gunorg);
+
+               if(autocvar_cl_followmodel_velocity_absolute)
+               {
+                       vector fixed_gunorg;
+                       vector forward, right = '0 0 0', up = '0 0 0';
+                       MAKEVECTORS(makevectors, view_angles, forward, right, up);
+                       fixed_gunorg.x = gunorg * forward;
+                       fixed_gunorg.y = gunorg * right * -1;
+                       fixed_gunorg.z = gunorg * up;
+                       gunorg = fixed_gunorg;
+               }
+
+               this.origin += gunorg;
+       }
+
+       if(autocvar_cl_leanmodel)
+       {
+               vector gunangles = '0 0 0';
+               static vector gunangles_prev = '0 0 0';
+               static vector gunangles_highpass = '0 0 0';
+               static vector gunangles_adjustment_highpass;
+               static vector gunangles_adjustment_lowpass;
+
+               if (teleported)
+                       gunangles_prev = view_angles;
+
+               // in the highpass, we _store_ the DIFFERENCE to the actual view angles...
+               gunangles_highpass += gunangles_prev;
+               PITCH(gunangles_highpass) += 360 * floor((PITCH(view_angles) - PITCH(gunangles_highpass)) / 360 + 0.5);
+               YAW(gunangles_highpass) += 360 * floor((YAW(view_angles) - YAW(gunangles_highpass)) / 360 + 0.5);
+               ROLL(gunangles_highpass) += 360 * floor((ROLL(view_angles) - ROLL(gunangles_highpass)) / 360 + 0.5);
+               frac = avg_factor(autocvar_cl_leanmodel_highpass1);
+               highpass2_limited(view_angles, frac, autocvar_cl_leanmodel_limit, gunangles_highpass, gunangles);
                gunangles_prev = view_angles;
-               gunorg_prev = view_origin;
-       }
-
-       static vector gunorg_highpass = '0 0 0';
-
-       // 2. for the gun origin, only keep the high frequency (non-DC) parts, which is "somewhat like velocity"
-       gunorg_highpass += gunorg_prev;
-       highpass3_limited(view_origin,
-               frametime * autocvar_cl_followmodel_side_highpass1, autocvar_cl_followmodel_side_limit,
-               frametime * autocvar_cl_followmodel_side_highpass1, autocvar_cl_followmodel_side_limit,
-               frametime * autocvar_cl_followmodel_up_highpass1, autocvar_cl_followmodel_up_limit,
-               gunorg_highpass, gunorg);
-       gunorg_prev = view_origin;
-       gunorg_highpass -= gunorg_prev;
-
-       static vector gunangles_highpass = '0 0 0';
-
-       // in the highpass, we _store_ the DIFFERENCE to the actual view angles...
-       gunangles_highpass += gunangles_prev;
-       PITCH(gunangles_highpass) += 360 * floor((PITCH(view_angles) - PITCH(gunangles_highpass)) / 360 + 0.5);
-       YAW(gunangles_highpass) += 360 * floor((YAW(view_angles) - YAW(gunangles_highpass)) / 360 + 0.5);
-       ROLL(gunangles_highpass) += 360 * floor((ROLL(view_angles) - ROLL(gunangles_highpass)) / 360 + 0.5);
-       highpass3_limited(view_angles,
-               frametime * autocvar_cl_leanmodel_up_highpass1, autocvar_cl_leanmodel_up_limit,
-               frametime * autocvar_cl_leanmodel_side_highpass1, autocvar_cl_leanmodel_side_limit,
-               0, 0,
-               gunangles_highpass, gunangles);
-       gunangles_prev = view_angles;
-       gunangles_highpass -= gunangles_prev;
-
-       // 3. calculate the RAW adjustment vectors
-       gunorg.x *= (autocvar_cl_followmodel ? -autocvar_cl_followmodel_side_speed : 0);
-       gunorg.y *= (autocvar_cl_followmodel ? -autocvar_cl_followmodel_side_speed : 0);
-       gunorg.z *= (autocvar_cl_followmodel ? -autocvar_cl_followmodel_up_speed : 0);
-
-       PITCH(gunangles) *= (autocvar_cl_leanmodel ? -autocvar_cl_leanmodel_up_speed : 0);
-       YAW(gunangles) *= (autocvar_cl_leanmodel ? -autocvar_cl_leanmodel_side_speed : 0);
-       ROLL(gunangles) = 0;
-
-       static vector gunorg_adjustment_highpass;
-       static vector gunorg_adjustment_lowpass;
-       static vector gunangles_adjustment_highpass;
-       static vector gunangles_adjustment_lowpass;
-
-       // 4. perform highpass/lowpass on the adjustment vectors (turning velocity into acceleration!)
-       //    trick: we must do the lowpass LAST, so the lowpass vector IS the final vector!
-       highpass3(gunorg,
-               frametime * autocvar_cl_followmodel_side_highpass,
-               frametime * autocvar_cl_followmodel_side_highpass,
-               frametime * autocvar_cl_followmodel_up_highpass,
-               gunorg_adjustment_highpass, gunorg);
-       lowpass3(gunorg,
-               frametime * autocvar_cl_followmodel_side_lowpass,
-               frametime * autocvar_cl_followmodel_side_lowpass,
-               frametime * autocvar_cl_followmodel_up_lowpass,
-               gunorg_adjustment_lowpass, gunorg);
-       // we assume here: PITCH = 0, YAW = 1, ROLL = 2
-       highpass3(gunangles,
-               frametime * autocvar_cl_leanmodel_up_highpass,
-               frametime * autocvar_cl_leanmodel_side_highpass,
-               0,
-               gunangles_adjustment_highpass, gunangles);
-       lowpass3(gunangles,
-               frametime * autocvar_cl_leanmodel_up_lowpass,
-               frametime * autocvar_cl_leanmodel_side_lowpass,
-               0,
-               gunangles_adjustment_lowpass, gunangles);
+               gunangles_highpass -= gunangles_prev;
+
+               PITCH(gunangles) *= -autocvar_cl_leanmodel_speed;
+               YAW(gunangles) *= -autocvar_cl_leanmodel_speed;
+
+               // we assume here: PITCH = 0, YAW = 1, ROLL = 2
+               frac = avg_factor(autocvar_cl_leanmodel_highpass);
+               highpass2(gunangles, frac, gunangles_adjustment_highpass, gunangles);
+               frac = avg_factor(autocvar_cl_leanmodel_lowpass);
+               lowpass2(gunangles, frac, gunangles_adjustment_lowpass, gunangles);
+
+               gunangles.x = -gunangles.x; // pitch was inverted, now that actually matters
+               this.angles += gunangles;
+       }
+
        float xyspeed = bound(0, vlen(vec2(view.velocity)), 400);
 
        // vertical view bobbing code
@@ -229,7 +257,6 @@ void viewmodel_animate(entity this)
                // Sajt: I tried to smooth out the transitions between bob and no bob, which works
                // for the most part, but for some reason when you go through a message trigger or
                // pick up an item or anything like that it will momentarily jolt the gun.
-               vector forward, right = '0 0 0', up = '0 0 0';
                float bspeed;
                float t = 1;
                float s = time * autocvar_cl_bobmodel_speed;
@@ -251,17 +278,12 @@ void viewmodel_animate(entity this)
                        t *= 5;
                }
                bspeed = xyspeed * 0.01;
-               MAKEVECTORS(makevectors, view_angles, forward, right, up);
-               float bobr = bspeed * autocvar_cl_bobmodel_side * autocvar_cl_viewmodel_scale * sin(s) * t;
-               gunorg += bobr * right;
-               float bobu = bspeed * autocvar_cl_bobmodel_up * autocvar_cl_viewmodel_scale * cos(s * 2) * t;
-               gunorg += bobu * up;
-       }
-       vector v = rotate(gunorg, YAW(view_angles) * DEG2RAD); // rotate world coordinates to relative ones
-       v.z = gunorg.z;
-       this.origin += v;
-       gunangles.x = -gunangles.x; // pitch was inverted, now that actually matters
-       this.angles += gunangles;
+               vector gunorg = '0 0 0';
+               gunorg.y += bspeed * autocvar_cl_bobmodel_side * autocvar_cl_viewmodel_scale * sin(s) * t;
+               gunorg.z += bspeed * autocvar_cl_bobmodel_up * autocvar_cl_viewmodel_scale * cos(s * 2) * t;
+
+               this.origin += gunorg;
+       }
 }
 
 .vector viewmodel_origin, viewmodel_angles;
@@ -271,6 +293,8 @@ void viewmodel_animate(entity this)
 
 void viewmodel_draw(entity this)
 {
+       if(!activeweapon)
+               return;
        int mask = (intermission || (STAT(HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL;
        float a = this.alpha;
        static bool wasinvehicle;
@@ -341,7 +365,6 @@ entity viewmodel;
 STATIC_INIT(viewmodel) {
     viewmodel = new(viewmodel);
     make_pure(viewmodel);
-       viewmodel.draw = viewmodel_draw;
 }
 
 entity porto;
@@ -1654,6 +1677,10 @@ void CSQC_UpdateView(float w, float h)
                ov_enabled = false;
        }
 
+       // run viewmodel_draw before updating view_angles to the angles calculated by WarpZone_FixView
+       // viewmodel_draw needs to use the view_angles set by the engine on every CSQC_UpdateView call
+       viewmodel_draw(viewmodel);
+
        // Render the Scene
        view_origin = getpropertyvec(VF_ORIGIN);
        view_angles = getpropertyvec(VF_ANGLES);
index 061ec2c74bc228615786d4a2588e0a4a82856612..f13b231042d41fccbd9d265611e6ca04182b38b6 100644 (file)
        REGISTER_NET_TEMP(globalsound)
        REGISTER_NET_TEMP(playersound)
 
+       string GlobalSound_sample(string pair, float r);
+
        #ifdef SVQC
+               /** Use new sound handling. TODO: use when sounds play correctly on clients */
+               bool autocvar_g_debug_globalsounds = false;
                /**
                 * @param from the source entity, its position is sent
                 * @param gs the global sound def
                {
                        assert(IS_PLAYER(from), eprint(from));
                        if (channel == MSG_ONE && !IS_REAL_CLIENT(msg_entity)) return;
+                       if (!autocvar_g_debug_globalsounds) {
+                               string sample = GlobalSound_sample(gs.m_globalsoundstr, r);
+                               switch (channel) {
+                                       case MSG_ONE:
+                                               soundto(channel, from, chan, sample, vol, atten);
+                                               break;
+                                       case MSG_ALL:
+                                               _sound(from, chan, sample, vol, atten);
+                                               break;
+                               }
+                               return;
+                       }
                        WriteHeader(channel, globalsound);
                        WriteByte(channel, gs.m_id);
                        WriteByte(channel, r * 255);
                {
                        assert(IS_PLAYER(from), eprint(from));
                        if (channel == MSG_ONE && !IS_REAL_CLIENT(msg_entity)) return;
+                       if (!autocvar_g_debug_globalsounds) {
+                               UpdatePlayerSounds(from);
+                               string s = from.(ps.m_playersoundfld);
+                               string sample = GlobalSound_sample(s, r);
+                               switch (channel) {
+                                       case MSG_ONE:
+                                               soundto(channel, from, chan, sample, vol, atten);
+                                               break;
+                                       case MSG_ALL:
+                                               _sound(from, chan, sample, vol, atten);
+                                               break;
+                               }
+                               return;
+                       }
                        WriteHeader(channel, playersound);
                        WriteByte(channel, ps.m_id);
                        WriteByte(channel, r * 255);
@@ -60,8 +90,6 @@
                }
        #endif
 
-       string GlobalSound_sample(string pair, float r);
-
        #ifdef CSQC
 
                NET_HANDLE(globalsound, bool isnew)
                fclose(fh);
        }
 
-       #ifdef CSQC
+       //#ifdef CSQC
 
                .string GetPlayerSoundSampleField(string type)
                {
 
                void ClearPlayerSounds(entity this)
                {
-                       FOREACH(PlayerSounds, true, LAMBDA(
+                       FOREACH(PlayerSounds, true, {
                                .string fld = it.m_playersoundfld;
                                if (this.(fld))
-       {
-               strunzone(this.(fld));
-               this.(fld) = string_null;
-       }
-                                                             ));
+                               {
+                                       strunzone(this.(fld));
+                                       this.(fld) = string_null;
+                               }
+                       });
                }
 
                bool LoadPlayerSounds(entity this, string f, bool strict)
                        LoadPlayerSounds(this, get_model_datafilename(this.model, 0, "sounds"), true);
                }
 
-       #endif
+       //#endif
 
        #ifdef SVQC
 
-               bool autocvar_g_debug_globalsounds;
-
                void _GlobalSound(entity this, entity gs, entity ps, string sample, int chan, int voicetype, bool fake)
                {
                        if (gs == NULL && ps == NULL && sample == "") return;
                                                                    ? bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, \
                                                                        ATTEN_MAX) \
                                                                        : ATTEN_NONE; \
-                                                               if (gs) \
-                                                               { \
-                                                                       if(autocvar_g_debug_globalsounds) \
-                                                                               globalsound(MSG_ONE, this, gs, r, chan, VOL_BASEVOICE, atten); \
-                                                                       else \
-                                                                               soundto(MSG_ONE, this, chan, GlobalSound_sample(gs.m_globalsoundstr, r), VOL_BASE, ATTEN_NORM); \
-                                                               } \
+                                                               if (gs) globalsound(MSG_ONE, this, gs, r, chan, VOL_BASEVOICE, atten); \
                                                                else if (ps) playersound(MSG_ONE, this, ps, r, chan, VOL_BASEVOICE, atten); \
                                                                else soundto(MSG_ONE, this, chan, sample, VOL_BASEVOICE, atten); \
                                                        } \
                                        }
                                        else
                                        {
-                                               if (gs)
-                                               {
-                                                       if(autocvar_g_debug_globalsounds)
-                                                               globalsound(MSG_ALL, this, gs, r, chan, VOL_BASE, ATTEN_NORM);
-                                                       else
-                                                               _sound(this, chan, GlobalSound_sample(gs.m_globalsoundstr, r), VOL_BASE, ATTEN_NORM);
-                                               }
+                                               if (gs) globalsound(MSG_ALL, this, gs, r, chan, VOL_BASE, ATTEN_NORM);
                                                else if (ps) playersound(MSG_ALL, this, ps, r, chan, VOL_BASE, ATTEN_NORM);
                                                else _sound(this, chan, sample, VOL_BASE, ATTEN_NORM);
                                        }
index 1c2aa64612a089652596da6014814890d752de1f..22e04e94a7f6d77a0b5324968cd027de24fe1909 100644 (file)
@@ -108,13 +108,13 @@ REGISTER_GLOBALSOUND(FALL_METAL, "misc/metalhitground 4")
 
 bool GetPlayerSoundSampleField_notFound;
 void PrecachePlayerSounds(string f);
-#ifdef CSQC
+//#ifdef CSQC
        .string GetVoiceMessageSampleField(string type);
        .string GetPlayerSoundSampleField(string type);
        void ClearPlayerSounds(entity this);
        float LoadPlayerSounds(entity this, string f, bool strict);
        void UpdatePlayerSounds(entity this);
-#endif
+//#endif
 
 #ifdef SVQC
 
index 6a585e68ed9694e1d12bf0e5e713c65f342b2179..8b4f9234d04dcf216a3dc35e4c9ea9ebca0e0f42 100644 (file)
@@ -685,7 +685,7 @@ void HUD_Minigame_Mouse()
        if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) )
                HUD_MinigameMenu_MouseInput();
 
-       draw_cursor_normal(mousepos-'8 4 0', '1 1 1', panel_fg_alpha);
+       draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha);
 }
 
 bool HUD_Minigame_Showpanels()
index ccc3b83aa982915a816d9d9e3405fa3f0d3d99b7..346062d64bb0da1daa6171a3a739beae051f1547 100644 (file)
@@ -1361,6 +1361,9 @@ bool Monster_Spawn(entity this, int mon_id)
        if(autocvar_g_nodepthtestplayers) { this.effects |= EF_NODEPTHTEST; }
        if(mon.spawnflags & MONSTER_TYPE_SWIM) { this.flags |= FL_SWIM; }
 
+       if(autocvar_g_playerclip_collisions)
+               this.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
+
        if(mon.spawnflags & MONSTER_TYPE_FLY)
        {
                this.flags |= FL_FLY;
index fcfce9ab77fb5f686013e9d162b874ec618c10ae..b54ee9176b1a68da7629d24bd7db2f210195f1ab 100644 (file)
@@ -2,6 +2,12 @@
 
 #ifdef IMPLEMENTATION
 
+#ifdef SVQC
+bool autocvar_g_nades_nade_small;
+#endif
+
+REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
+
 #ifndef MENUQC
 entity Nade_TrailEffect(int proj, int nade_team)
 {
@@ -63,8 +69,16 @@ MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile)
 
        entity nade_type = Nade_FromProjectile(self.cnt);
        if (nade_type == NADE_TYPE_Null) return;
-       self.mins = '-16 -16 -16';
-       self.maxs = '16 16 16';
+       if(STAT(NADES_SMALL, NULL))
+       {
+               self.mins = '-8 -8 -8';
+               self.maxs = '8 8 8';
+       }
+       else
+       {
+               self.mins = '-16 -16 -16';
+               self.maxs = '16 16 16';
+       }
        self.colormod = nade_type.m_color;
        self.move_movetype = MOVETYPE_BOUNCE;
        self.move_touch = func_null;
@@ -657,6 +671,20 @@ void nade_boom()
        remove(self);
 }
 
+void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, string pntype);
+void nade_pickup(entity this, entity thenade)
+{
+       spawn_held_nade(this, thenade.realowner, autocvar_g_nades_pickup_time, thenade.nade_type, thenade.pokenade_type);
+
+       // set refire so player can't even
+       this.nade_refire = time + autocvar_g_nades_nade_refire;
+       this.nade_timer = 0;
+
+       if(this.nade)
+               this.nade.nade_time_primed = thenade.nade_time_primed;
+}
+
+bool CanThrowNade(entity this);
 void nade_touch()
 {SELFPARAM();
        if(other)
@@ -664,6 +692,19 @@ void nade_touch()
 
        if(other == self.realowner)
                return; // no self impacts
+
+       if(autocvar_g_nades_pickup)
+       if(time >= self.spawnshieldtime)
+       if(!other.nade && self.health == self.max_health) // no boosted shot pickups, thank you very much
+       if(!other.frozen)
+       if(CanThrowNade(other)) // prevent some obvious things, like dead players
+       if(IS_REAL_CLIENT(other)) // above checks for IS_PLAYER, don't need to do it here
+       {
+               nade_pickup(other, self);
+               sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
+               remove(self);
+               return;
+       }
        /*float is_weapclip = 0;
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
        if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
@@ -766,7 +807,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i
                nade_burn_spawn(this);
 }
 
-void toss_nade(entity e, vector _velocity, float _time)
+void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
 {SELFPARAM();
        if(e.nade == world)
                return;
@@ -793,7 +834,10 @@ void toss_nade(entity e, vector _velocity, float _time)
        //setmodel(_nade, MDL_PROJECTILE_NADE);
        //setattachment(_nade, world, "");
        PROJECTILE_MAKETRIGGER(_nade);
-       setsize(_nade, '-16 -16 -16', '16 16 16');
+       if(STAT(NADES_SMALL, e))
+               setsize(_nade, '-8 -8 -8', '8 8 8');
+       else
+               setsize(_nade, '-16 -16 -16', '16 16 16');
        _nade.movetype = MOVETYPE_BOUNCE;
 
        tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade);
@@ -809,7 +853,11 @@ void toss_nade(entity e, vector _velocity, float _time)
        else
                _nade.velocity = W_CalculateProjectileVelocity(e.velocity, _velocity, true);
 
+       if(set_owner)
+               _nade.realowner = e;
+
        _nade.touch = nade_touch;
+       _nade.spawnshieldtime = time + 0.1; // prevent instantly picking up again
        _nade.health = autocvar_g_nades_nade_health;
        _nade.max_health = _nade.health;
        _nade.takedamage = DAMAGE_AIM;
@@ -881,7 +929,7 @@ MUTATOR_HOOKFUNCTION(nades, PutClientInServer)
 float nade_customize()
 {SELFPARAM();
        //if(IS_SPEC(other)) { return false; }
-       if(other == self.realowner || (IS_SPEC(other) && other.enemy == self.realowner))
+       if(other == self.exteriormodeltoclient || (IS_SPEC(other) && other.enemy == self.exteriormodeltoclient))
        {
                // somewhat hide the model, but keep the glow
                //self.effects = 0;
@@ -900,6 +948,42 @@ float nade_customize()
        return true;
 }
 
+void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, string pntype)
+{
+       entity n = new(nade), fn = new(fake_nade);
+
+       n.nade_type = bound(1, ntype, Nades_COUNT);
+       n.pokenade_type = pntype;
+
+       setmodel(n, MDL_PROJECTILE_NADE);
+       //setattachment(n, player, "bip01 l hand");
+       n.exteriormodeltoclient = player;
+       n.customizeentityforclient = nade_customize;
+       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], player.team).eent_eff_name);
+       n.colormod = Nades_from(n.nade_type).m_color;
+       n.realowner = nowner;
+       n.colormap = player.colormap;
+       n.glowmod = player.glowmod;
+       n.wait = time + max(0, ntime);
+       n.nade_time_primed = time;
+       n.think = nade_beep;
+       n.nextthink = max(n.wait - 3, time);
+       n.projectiledeathtype = DEATH_NADE.m_id;
+
+       setmodel(fn, MDL_NADE_VIEW);
+       .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+       setattachment(fn, player.(weaponentity), "");
+       fn.realowner = fn.owner = player;
+       fn.colormod = Nades_from(n.nade_type).m_color;
+       fn.colormap = player.colormap;
+       fn.glowmod = player.glowmod;
+       fn.think = SUB_Remove_self;
+       fn.nextthink = n.wait;
+
+       player.nade = n;
+       player.fake_nade = fn;
+}
+
 void nade_prime()
 {SELFPARAM();
        if(autocvar_g_nades_bonus_only)
@@ -912,71 +996,44 @@ void nade_prime()
        if(self.fake_nade)
                remove(self.fake_nade);
 
-       entity n = new(nade), fn = new(fake_nade);
+       int ntype;
+       string pntype = self.pokenade_type;
 
        if(self.items & ITEM_Strength.m_itemid && autocvar_g_nades_bonus_onstrength)
-               n.nade_type = self.nade_type;
+               ntype = self.nade_type;
        else if (self.bonus_nades >= 1)
        {
-               n.nade_type = self.nade_type;
-               n.pokenade_type = self.pokenade_type;
+               ntype = self.nade_type;
+               pntype = self.pokenade_type;
                self.bonus_nades -= 1;
        }
        else
        {
-               n.nade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_nade_type : autocvar_g_nades_nade_type);
-               n.pokenade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
+               ntype = ((autocvar_g_nades_client_select) ? self.cvar_cl_nade_type : autocvar_g_nades_nade_type);
+               pntype = ((autocvar_g_nades_client_select) ? self.cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
        }
 
-       n.nade_type = bound(1, n.nade_type, Nades_COUNT);
-
-       setmodel(n, MDL_PROJECTILE_NADE);
-       //setattachment(n, self, "bip01 l hand");
-       n.exteriormodeltoclient = self;
-       n.customizeentityforclient = nade_customize;
-       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], self.team).eent_eff_name);
-       n.colormod = Nades_from(n.nade_type).m_color;
-       n.realowner = self;
-       n.colormap = self.colormap;
-       n.glowmod = self.glowmod;
-       n.wait = time + autocvar_g_nades_nade_lifetime;
-       n.nade_time_primed = time;
-       n.think = nade_beep;
-       n.nextthink = max(n.wait - 3, time);
-       n.projectiledeathtype = DEATH_NADE.m_id;
-
-       setmodel(fn, MDL_NADE_VIEW);
-       .entity weaponentity = weaponentities[0]; // TODO: unhardcode
-       setattachment(fn, self.(weaponentity), "");
-       fn.realowner = fn.owner = self;
-       fn.colormod = Nades_from(n.nade_type).m_color;
-       fn.colormap = self.colormap;
-       fn.glowmod = self.glowmod;
-       fn.think = SUB_Remove_self;
-       fn.nextthink = n.wait;
-
-       self.nade = n;
-       self.fake_nade = fn;
+       spawn_held_nade(self, self, autocvar_g_nades_nade_lifetime, ntype, pntype);
 }
 
-float CanThrowNade()
-{SELFPARAM();
-       if(self.vehicle)
+bool CanThrowNade(entity this)
+{
+       if(this.vehicle)
                return false;
 
        if(gameover)
                return false;
 
-       if(IS_DEAD(self))
+       if(IS_DEAD(this))
                return false;
 
        if (!autocvar_g_nades)
                return false; // allow turning them off mid match
 
-       if(forbidWeaponUse(self))
+       if(forbidWeaponUse(this))
                return false;
 
-       if (!IS_PLAYER(self))
+       if (!IS_PLAYER(this))
                return false;
 
        return true;
@@ -986,7 +1043,7 @@ float CanThrowNade()
 
 void nades_CheckThrow()
 {SELFPARAM();
-       if(!CanThrowNade())
+       if(!CanThrowNade(self))
                return;
 
        entity held_nade = self.nade;
@@ -1008,7 +1065,7 @@ void nades_CheckThrow()
                        float _force = time - held_nade.nade_time_primed;
                        _force /= autocvar_g_nades_nade_lifetime;
                        _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
-                       toss_nade(self, (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05) * _force, 0);
+                       toss_nade(self, true, (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05) * _force, 0);
                }
        }
 }
@@ -1027,7 +1084,7 @@ void nades_Clear(entity player)
 MUTATOR_HOOKFUNCTION(nades, VehicleEnter)
 {
        if(vh_player.nade)
-               toss_nade(vh_player, '0 0 100', max(vh_player.nade.wait, time + 0.05));
+               toss_nade(vh_player, true, '0 0 100', max(vh_player.nade.wait, time + 0.05));
 
        return false;
 }
@@ -1046,10 +1103,10 @@ CLASS(NadeOffhand, OffhandWeapon)
                        held_nade.angles_y = player.angles.y;
 
                        if (time + 0.1 >= held_nade.wait)
-                               toss_nade(player, '0 0 0', time + 0.05);
+                               toss_nade(player, false, '0 0 0', time + 0.05);
                }
 
-        if (!CanThrowNade()) return;
+        if (!CanThrowNade(player)) return;
         if (!(time > player.nade_refire)) return;
                if (key_pressed) {
                        if (!held_nade) {
@@ -1062,7 +1119,7 @@ CLASS(NadeOffhand, OffhandWeapon)
                                float _force = time - held_nade.nade_time_primed;
                                _force /= autocvar_g_nades_nade_lifetime;
                                _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
-                               toss_nade(player, (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0);
+                               toss_nade(player, false, (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0);
                        }
                }
     }
@@ -1201,7 +1258,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
 {
        if(frag_target.nade)
        if(!STAT(FROZEN, frag_target) || !autocvar_g_freezetag_revive_nade)
-               toss_nade(frag_target, '0 0 100', max(frag_target.nade.wait, time + 0.05));
+               toss_nade(frag_target, true, '0 0 100', max(frag_target.nade.wait, time + 0.05));
 
        float killcount_bonus = ((frag_attacker.killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * frag_attacker.killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor);
 
@@ -1264,7 +1321,7 @@ MUTATOR_HOOKFUNCTION(nades, MonsterDies)
 MUTATOR_HOOKFUNCTION(nades, DropSpecialItems)
 {
        if(frag_target.nade)
-               toss_nade(frag_target, '0 0 0', time + 0.05);
+               toss_nade(frag_target, true, '0 0 0', time + 0.05);
 
        return false;
 }
index 0da3c1df375520f02ab2608b824d6f8afaa4bbe6..208b16c3b8f6473acde347790d82cd23d0425619 100644 (file)
@@ -1283,6 +1283,10 @@ bool IsFlying(entity this)
        return true;
 }
 
+#ifdef CSQC
+float autocvar_slowmo;
+#endif
+
 void PM_Main(entity this)
 {
        int buttons = PHYS_INPUT_BUTTON_MASK(this);
@@ -1321,6 +1325,9 @@ void PM_Main(entity this)
        if (this.PlayerPhysplug)
                if (this.PlayerPhysplug())
                        return;
+#elif defined(CSQC)
+       if(autocvar_slowmo != STAT(MOVEVARS_TIMESCALE))
+               cvar_set("slowmo", ftos(STAT(MOVEVARS_TIMESCALE)));
 #endif
 
 #ifdef SVQC
index 0bb3ac1742e0e0991f9f90b5694fb17ef7b4b0ae..7003dfd7f1dd1a74176eace324b6ecf3317feed2 100644 (file)
@@ -1529,7 +1529,7 @@ spawnfunc(target_items)
                if(self.ammo_plasma != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_plasma), "plasma");
                if(self.ammo_fuel != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_fuel), "fuel");
                if(self.health != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "health");
-               if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "armor");
+               if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.armorvalue), "armor");
                FOREACH(Weapons, it != WEP_Null, LAMBDA(self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname)));
        }
        self.netname = strzone(self.netname);
index d531b8c3f29759f1c8a9c77e922c0199dc96c26c..6232db886e7a810c8f72b403803fb5c202563e77 100644 (file)
@@ -432,6 +432,7 @@ void CL_WeaponEntity_SetModel(entity this, string name)
 #endif
                        }
                        _setmodel(this.weaponchild, W_Model(strcat("v_", name, ".md3")));
+                       setsize(this.weaponchild, '0 0 0', '0 0 0');
                        setattachment(this.weaponchild, this, t);
                }
                else
@@ -440,6 +441,7 @@ void CL_WeaponEntity_SetModel(entity this, string name)
                        this.weaponchild = NULL;
                }
 
+               setsize(this, '0 0 0', '0 0 0');
                setorigin(this, '0 0 0');
                this.angles = '0 0 0';
                this.frame = 0;
index 3c4e4c43fbc442e0d502e3d065a5fe8cd1714b8d..654bd2bc936efffaea6c0df1b8c0f1f6d72961ab 100644 (file)
@@ -465,6 +465,8 @@ vector autocvar_g_nades_throw_offset;
 bool autocvar_g_nades_spawn;
 int autocvar_g_nades_spawn_count;
 bool autocvar_g_nades_client_select;
+bool autocvar_g_nades_pickup = true;
+float autocvar_g_nades_pickup_time = 2;
 float autocvar_g_nades_nade_lifetime;
 float autocvar_g_nades_nade_minforce;
 float autocvar_g_nades_nade_maxforce;
index 4972d818f3a8db4be0c27a0076cef39d2f11f509..1637d867663333b6fef51d276e69ba532ef54e0d 100644 (file)
@@ -126,7 +126,11 @@ void CL_ExteriorWeaponentity_Think()
                this.weaponname = this.owner.weaponname;
                this.dmg = this.owner.modelindex;
                this.deadflag = this.owner.deadflag;
-               if (this.owner.weaponname != "") _setmodel(this, W_Model(strcat("v_", this.owner.weaponname, ".md3")));
+               if (this.owner.weaponname != "")
+               {
+                       _setmodel(this, W_Model(strcat("v_", this.owner.weaponname, ".md3")));
+                       setsize(this, '0 0 0', '0 0 0');
+               }
                else this.model = "";
 
                int tag_found;
index c5c673fbff9c6ad627a3b746f1c28c5c14bfcb59..bef31839299fda9518ad081b2e51b2d06af7c29a 100644 (file)
@@ -31,11 +31,11 @@ glauncher
                rgbgen lightingDiffuse
        }
 }
-hagar2
+hagar
 {
        dpreflectcube cubemaps/default/sky
        {
-               map textures/hagar2.tga
+               map textures/hagar.tga
                rgbgen lightingDiffuse
        }
 }
@@ -111,3 +111,11 @@ shotgun
                rgbgen lightingDiffuse
        }
 }
+SniperRifle
+{
+       dpreflectcube cubemaps/default/sky
+       {
+               map textures/sniperrifle.tga
+               rgbgen lightingDiffuse
+       }
+}
diff --git a/textures/campingrifle.tga b/textures/campingrifle.tga
deleted file mode 100644 (file)
index 6189b51..0000000
Binary files a/textures/campingrifle.tga and /dev/null differ
diff --git a/textures/campingrifle_bump.tga b/textures/campingrifle_bump.tga
deleted file mode 100644 (file)
index 28bd453..0000000
Binary files a/textures/campingrifle_bump.tga and /dev/null differ
diff --git a/textures/campingrifle_gloss.tga b/textures/campingrifle_gloss.tga
deleted file mode 100644 (file)
index 7f4b032..0000000
Binary files a/textures/campingrifle_gloss.tga and /dev/null differ
diff --git a/textures/campingrifle_glow.tga b/textures/campingrifle_glow.tga
deleted file mode 100644 (file)
index f425329..0000000
Binary files a/textures/campingrifle_glow.tga and /dev/null differ
diff --git a/textures/campingrifle_screen.tga b/textures/campingrifle_screen.tga
deleted file mode 100644 (file)
index 5ffda6f..0000000
Binary files a/textures/campingrifle_screen.tga and /dev/null differ
diff --git a/textures/hagar.tga b/textures/hagar.tga
new file mode 100644 (file)
index 0000000..1e2d5cf
Binary files /dev/null and b/textures/hagar.tga differ
diff --git a/textures/hagar2.tga b/textures/hagar2.tga
deleted file mode 100644 (file)
index f05fef9..0000000
Binary files a/textures/hagar2.tga and /dev/null differ
diff --git a/textures/hagar2_gloss.tga b/textures/hagar2_gloss.tga
deleted file mode 100644 (file)
index f4f597a..0000000
Binary files a/textures/hagar2_gloss.tga and /dev/null differ
diff --git a/textures/hagar2_glow.tga b/textures/hagar2_glow.tga
deleted file mode 100644 (file)
index cd4b353..0000000
Binary files a/textures/hagar2_glow.tga and /dev/null differ
diff --git a/textures/hagar2_norm.tga b/textures/hagar2_norm.tga
deleted file mode 100644 (file)
index 145509d..0000000
Binary files a/textures/hagar2_norm.tga and /dev/null differ
diff --git a/textures/hagar2_reflect.tga b/textures/hagar2_reflect.tga
deleted file mode 100644 (file)
index 1381edc..0000000
Binary files a/textures/hagar2_reflect.tga and /dev/null differ
diff --git a/textures/hagar2_shirt.tga b/textures/hagar2_shirt.tga
deleted file mode 100644 (file)
index 4527f7e..0000000
Binary files a/textures/hagar2_shirt.tga and /dev/null differ
diff --git a/textures/hagar_glow.tga b/textures/hagar_glow.tga
new file mode 100644 (file)
index 0000000..e1d9548
Binary files /dev/null and b/textures/hagar_glow.tga differ
diff --git a/textures/hagar_norm.tga b/textures/hagar_norm.tga
new file mode 100644 (file)
index 0000000..b758791
Binary files /dev/null and b/textures/hagar_norm.tga differ
diff --git a/textures/hagar_reflect.tga b/textures/hagar_reflect.tga
new file mode 100644 (file)
index 0000000..f784c2d
Binary files /dev/null and b/textures/hagar_reflect.tga differ
diff --git a/textures/hagar_shirt.tga b/textures/hagar_shirt.tga
new file mode 100644 (file)
index 0000000..270d446
Binary files /dev/null and b/textures/hagar_shirt.tga differ
diff --git a/textures/hagar_spec.tga b/textures/hagar_spec.tga
new file mode 100644 (file)
index 0000000..e44d88b
Binary files /dev/null and b/textures/hagar_spec.tga differ
diff --git a/textures/sniperrifle.tga b/textures/sniperrifle.tga
new file mode 100644 (file)
index 0000000..0448be7
Binary files /dev/null and b/textures/sniperrifle.tga differ
diff --git a/textures/sniperrifle_bump.tga b/textures/sniperrifle_bump.tga
new file mode 100644 (file)
index 0000000..2496bcb
Binary files /dev/null and b/textures/sniperrifle_bump.tga differ
diff --git a/textures/sniperrifle_glow.tga b/textures/sniperrifle_glow.tga
new file mode 100644 (file)
index 0000000..7767713
Binary files /dev/null and b/textures/sniperrifle_glow.tga differ
diff --git a/textures/sniperrifle_reflect.tga b/textures/sniperrifle_reflect.tga
new file mode 100644 (file)
index 0000000..ecd89a9
Binary files /dev/null and b/textures/sniperrifle_reflect.tga differ