]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/incompatible_mutators
authorterencehill <piuntn@gmail.com>
Tue, 7 Feb 2012 19:46:47 +0000 (20:46 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 7 Feb 2012 19:46:47 +0000 (20:46 +0100)
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/server/miscfunctions.qc

index ac2d71e4811aed58b51f6954b6e6e04afd29b8e0..328e3d79e0ed8556a8f16e583b993c427464f84f 100644 (file)
@@ -159,7 +159,21 @@ void preDrawLaserWeaponArenaLaserButton(entity me)
 }
 // WARNING: end of dirty hack. Do not try this at home.
 
-
+float checkCompatibility_pinata(entity me)
+{
+       string s;
+       if(cvar("g_minstagib"))
+               return 0;
+       if(cvar("g_nix"))
+               return 0;
+       if(cvar_string("g_weaponarena") != "0")
+               return 0;
+       return 1;
+}
+float checkCompatibility_weaponstay(entity me)
+{
+       return checkCompatibility_pinata(me);
+}
 
 void XonoticMutatorsDialog_fill(entity me)
 {
@@ -184,6 +198,7 @@ void XonoticMutatorsDialog_fill(entity me)
                me.TDempty(me, 0.2);
                s = makeXonoticSlider(10, 50, 1, "g_bloodloss");
                me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(0, 1, s, _("Blood loss")));
+                       setDependent(e, "g_minstagib", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 1.8, s);
@@ -214,9 +229,11 @@ void XonoticMutatorsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", _("PiƱata")));
+                       setDependentWeird(e, checkCompatibility_pinata);
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_weapon_stay", _("Weapons stay")));
+                       setDependentWeird(e, checkCompatibility_weaponstay);
        me.TR(me);
 
        me.gotoRC(me, 0, 2); me.setFirstColumn(me, me.currentColumn);
index b780a8511a882f96ace60faa8e8a82a9223002c3..d88f6f275eb5436ed0eb6005ef9545d4dce40938 100644 (file)
@@ -897,12 +897,18 @@ void readplayerstartcvars()
 
        if (g_weaponarena)
        {
+               g_minstagib = 0; // incompatible
+               g_pinata = 0; // incompatible
+               g_weapon_stay = 0; // incompatible
                start_weapons = g_weaponarena;
                if(!(g_lms || g_ca))
                        start_items |= IT_UNLIMITED_AMMO;
        }
        else if (g_minstagib)
        {
+               g_pinata = 0; // incompatible
+               g_weapon_stay = 0; // incompatible
+               g_bloodloss = 0; // incompatible
                start_health = 100;
                start_armorvalue = 0;
                start_weapons = WEPBIT_MINSTANEX;