From 165ddcdd90578a3babd8fb457a61e6834b4e7c6d Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 2 Feb 2012 00:31:05 +0100 Subject: [PATCH] Check for mutators compatibility in the menu too --- .../dialog_multiplayer_create_mutators.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c index ac2d71e48..328e3d79e 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c @@ -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); -- 2.39.2