]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option (disabled by default) to drop off-hand weapons while dual wielding...
authorMario <mario.mario@y7mail.com>
Sun, 15 Mar 2020 07:34:59 +0000 (17:34 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 15 Mar 2020 07:34:59 +0000 (17:34 +1000)
mutators.cfg
qcsrc/common/mutators/mutator/pinata/sv_pinata.qc
xonotic-server.cfg

index b6ad3468e0be9708d071c1abdb581e3175aa25ed..abf689625a20646571ccd41e8e826ec6ce3d5bcc 100644 (file)
@@ -522,3 +522,9 @@ set g_smneg_cooldown_factor 0.25 "Stale-move negation: penalty cooldown factor"
 set g_random_items 0 "Whether to enable random items."
 set g_random_loot 0 "Whether to enable random loot."
 exec randomitems-xonotic.cfg
+
+// ===============
+//  pinata
+// ===============
+set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
+set g_pinata_offhand 0 "if enabled, the second weapon will drop as well while dual wielding"
index 779e562b4a4286235891a56c8e43e43cfd0fb716..fa8045101e55b3b94f83f83e5437390ce8f213dc 100644 (file)
@@ -1,6 +1,7 @@
 #include "sv_pinata.qh"
 
 string autocvar_g_pinata;
+bool autocvar_g_pinata_offhand;
 REGISTER_MUTATOR(pinata, expr_evaluate(autocvar_g_pinata) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok));
 
 MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
@@ -14,6 +15,9 @@ MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
                if(frag_target.(weaponentity).m_weapon == WEP_Null)
                        continue;
 
+               if(slot > 0 && !autocvar_g_pinata_offhand)
+                       break;
+
                FOREACH(Weapons, it != WEP_Null, {
                        if(STAT(WEAPONS, frag_target) & WepSet_FromWeapon(it))
                        if(frag_target.(weaponentity).m_weapon != it)
index a128a801d89dda6cab884354d3f5855b7f93109d..843a83d3d6132ec8356508eadd838d5cdb32f2c1 100644 (file)
@@ -191,7 +191,6 @@ 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"
 set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved to the given y and z coordinates. If set to a string like x y z, the whole shot origin is used"
-set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
 set g_weapon_stay 0 "1: ghost weapons can be picked up but give no ammo, thrown guns have ammo 2: ghost weapons can be picked up and refill ammo to one pickup size, thrown guns have no ammo (to prevent infinite ammo abuse)"
 set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
 set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"