From: Mario Date: Tue, 24 Dec 2019 16:30:23 +0000 (+1000) Subject: Don't apply developer checks if developer is -1 X-Git-Tag: xonotic-v0.8.5~1189 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e5bf68755679ce3d635250e1d0873d548c6334e7;p=xonotic%2Fxonotic-data.pk3dir.git Don't apply developer checks if developer is -1 --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index d9b9efcde..3b7513013 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -444,7 +444,7 @@ STATIC_INIT(compressShortVector) l *= f; } - if(cvar("developer")) + if(cvar("developer") > 0) { LOG_TRACE("Verifying vector compression table..."); for(i = 0x0F00; i < 0xFFFF; ++i) diff --git a/qcsrc/lib/log.qh b/qcsrc/lib/log.qh index 94a58d0ca..16875c8bc 100644 --- a/qcsrc/lib/log.qh +++ b/qcsrc/lib/log.qh @@ -6,7 +6,7 @@ void print_assertfailed_severe(string expr); void print_assertfailed_fatal(string expr); #define assert(expr, ...) _assert(print_assertfailed_severe, expr, __VA_ARGS__) -#define devassert(...) MACRO_BEGIN if (autocvar_developer) assert(__VA_ARGS__); MACRO_END +#define devassert(...) MACRO_BEGIN if (autocvar_developer > 0) assert(__VA_ARGS__); MACRO_END #define assert_once(expr, ...) \ MACRO_BEGIN \ @@ -17,10 +17,10 @@ void print_assertfailed_fatal(string expr); __once = true; \ } \ MACRO_END -#define devassert_once(...) MACRO_BEGIN if (autocvar_developer) assert_once(__VA_ARGS__); MACRO_END +#define devassert_once(...) MACRO_BEGIN if (autocvar_developer > 0) assert_once(__VA_ARGS__); MACRO_END #define demand(expr, ...) _assert(print_assertfailed_fatal, expr, __VA_ARGS__) -#define devdemand(...) MACRO_BEGIN if (autocvar_developer) demand(__VA_ARGS__); MACRO_END +#define devdemand(...) MACRO_BEGIN if (autocvar_developer > 0) demand(__VA_ARGS__); MACRO_END #define _assert(f, expr, then) \ MACRO_BEGIN \ diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh index 9abeb1bcc..70e17e6cf 100644 --- a/qcsrc/lib/oo.qh +++ b/qcsrc/lib/oo.qh @@ -328,7 +328,7 @@ CLASS(Object) { TC(Object, this); string s = _("No description"); - if (cvar("developer")) + if (cvar("developer") > 0) { for (int i = 0, n = numentityfields(); i < n; ++i) { diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index f19557444..891235def 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -50,7 +50,7 @@ void m_gamestatus() gamestatus = 0; if (isserver()) gamestatus |= GAME_ISSERVER; if (clientstate() == CS_CONNECTED || isdemo()) gamestatus |= GAME_CONNECTED; - if (cvar("developer")) gamestatus |= GAME_DEVELOPER; + if (cvar("developer") > 0) gamestatus |= GAME_DEVELOPER; } void m_init() @@ -73,7 +73,7 @@ void m_init() #endif // list all game dirs (TEST) - if (cvar("developer")) + if (cvar("developer") > 0) { for (int i = 0; ; ++i) { diff --git a/qcsrc/menu/xonotic/dialog_settings_audio.qc b/qcsrc/menu/xonotic/dialog_settings_audio.qc index 7af8c5500..1f8c6d81c 100644 --- a/qcsrc/menu/xonotic/dialog_settings_audio.qc +++ b/qcsrc/menu/xonotic/dialog_settings_audio.qc @@ -172,7 +172,7 @@ void XonoticAudioSettingsTab_fill(entity me) e.sendCvars = true; me.TR(me); me.TR(me); - if(cvar("developer")) + if(cvar("developer") > 0) me.TD(me, 1, 3, makeXonoticCheckBox(0, "showsound", _("Debug info about sounds"))); me.gotoRC(me, me.rows - 1, 0); diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.qc b/qcsrc/menu/xonotic/dialog_settings_effects.qc index a9375327e..1776ed479 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.qc +++ b/qcsrc/menu/xonotic/dialog_settings_effects.qc @@ -39,8 +39,8 @@ void XonoticEffectsSettingsTab_fill(entity me) float n; me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:"))); - n = 5 + 2 * boolean(cvar("developer")); - if(cvar("developer")) + n = 5 + 2 * boolean(cvar("developer") > 0); + if(cvar("developer") > 0) { me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0)); e.applyButton = effectsApplyButton; @@ -55,7 +55,7 @@ void XonoticEffectsSettingsTab_fill(entity me) e.applyButton = effectsApplyButton; me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0)); e.applyButton = effectsApplyButton; - if(cvar("developer")) + if(cvar("developer") > 0) { me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0)); e.applyButton = effectsApplyButton; @@ -87,7 +87,7 @@ void XonoticEffectsSettingsTab_fill(entity me) me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:"))); setDependent(e, "r_showsurfaces", 0, 0); me.TD(me, 1, 2, e = makeXonoticPicmipSlider()); - if(cvar("developer")) + if(cvar("developer") > 0) e.addValue(e, ZCTX(_("RES^Leet")), "1337"); e.addValue(e, ZCTX(_("RES^Lowest")), "3"); e.addValue(e, ZCTX(_("RES^Very low")), "2"); @@ -125,7 +125,7 @@ void XonoticEffectsSettingsTab_fill(entity me) } } me.TR(me); - if(cvar("developer")) + if(cvar("developer") > 0) { me.TDempty(me, 0.2); me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx_T(3, 0, "r_showsurfaces", _("Show surfaces"), diff --git a/qcsrc/menu/xonotic/dialog_settings_misc.qc b/qcsrc/menu/xonotic/dialog_settings_misc.qc index 11e6ca2b5..1033919f4 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc.qc +++ b/qcsrc/menu/xonotic/dialog_settings_misc.qc @@ -60,7 +60,7 @@ void XonoticMiscSettingsTab_fill(entity me) e.addValue(e, strzone(_("Unlimited")), "0"); e.configureXonoticTextSliderValues(e); me.TR(me); - if(cvar("developer")) + if(cvar("developer") > 0) { me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Local latency:"))); me.TD(me, 1, 2, e = makeXonoticSlider(0, 1000, 25, "cl_netlocalping")); diff --git a/qcsrc/menu/xonotic/dialog_settings_video.qc b/qcsrc/menu/xonotic/dialog_settings_video.qc index 0e524b6e2..305567b7d 100644 --- a/qcsrc/menu/xonotic/dialog_settings_video.qc +++ b/qcsrc/menu/xonotic/dialog_settings_video.qc @@ -62,7 +62,7 @@ void XonoticVideoSettingsTab_fill(entity me) _("Enable vertical synchronization to prevent tearing, will cap your fps to the screen refresh rate"))); me.TR(me); - if(cvar("developer")) + if(cvar("developer") > 0) { me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "v_flipped", _("Flip view horizontally"), _("Poor man's left handed mode"))); @@ -162,7 +162,7 @@ void XonoticVideoSettingsTab_fill(entity me) me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"), _("Enable use of GLSL to apply gamma correction, note that it might decrease performance by a lot"))); setDependent(e, "vid_gl20", 1, 1); - if(cvar("developer")) + if(cvar("developer") > 0) { me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_psycho", _("Psycho coloring (easter egg)"))); diff --git a/qcsrc/menu/xonotic/slider_particles.qc b/qcsrc/menu/xonotic/slider_particles.qc index 72639fcb1..5e2b1bf81 100644 --- a/qcsrc/menu/xonotic/slider_particles.qc +++ b/qcsrc/menu/xonotic/slider_particles.qc @@ -11,13 +11,13 @@ void XonoticParticlesSlider_configureXonoticParticlesSlider(entity me) { me.configureXonoticTextSlider(me, "cl_particles_quality", _("Multiplier for amount of particles. Less means less particles, which in turn gives for better performance")); - if(cvar("developer")) { me.addValue(me, ZCTX(_("PART^OMG")), "0.25 250 0"); } + if(cvar("developer") > 0) { me.addValue(me, ZCTX(_("PART^OMG")), "0.25 250 0"); } me.addValue(me, ZCTX(_("PART^Low")), "0.5 500 0"); me.addValue(me, ZCTX(_("PART^Medium")), "0.75 750 0"); me.addValue(me, ZCTX(_("PART^Normal")), "1.0 1000 1"); me.addValue(me, ZCTX(_("PART^High")), "1.5 1500 1"); me.addValue(me, ZCTX(_("PART^Ultra")), "2.0 2000 2"); - if(cvar("developer")) { me.addValue(me, ZCTX(_("PART^Ultimate")), "3.0 3000 2"); } + if(cvar("developer") > 0) { me.addValue(me, ZCTX(_("PART^Ultimate")), "3.0 3000 2"); } me.configureXonoticTextSliderValues(me); } void XonoticParticlesSlider_loadCvars(entity me) diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index c203a9303..a126b9e5d 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -705,7 +705,7 @@ int GameType_GetCount() #define GAMETYPE(id) ++i; GAMETYPES #undef GAMETYPE - #define GAMETYPE(it) { if (dev) ++i; } + #define GAMETYPE(it) { if (dev > 0) ++i; } HIDDEN_GAMETYPES #undef GAMETYPE return i; diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index 7a40f18e8..c09d8f81d 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -470,7 +470,7 @@ entity waypoint_spawn(vector m1, vector m2, float f) } else { - if(autocvar_developer) + if(autocvar_developer > 0) { LOG_INFO("A generated waypoint is stuck in solid at ", vtos(w.origin)); backtrace("Waypoint stuck"); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 98616a763..3b74ae303 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1339,7 +1339,7 @@ void PrintToChat(entity client, string text) ERASEABLE void DebugPrintToChat(entity client, string text) { - if (autocvar_developer) + if (autocvar_developer > 0) { PrintToChat(client, text); } @@ -1355,7 +1355,7 @@ void PrintToChatAll(string text) ERASEABLE void DebugPrintToChatAll(string text) { - if (autocvar_developer) + if (autocvar_developer > 0) { PrintToChatAll(text); } @@ -1377,7 +1377,7 @@ void PrintToChatTeam(int team_num, string text) ERASEABLE void DebugPrintToChatTeam(int team_num, string text) { - if (autocvar_developer) + if (autocvar_developer > 0) { PrintToChatTeam(team_num, text); } diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 0c44a95f1..f739533fc 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -2262,7 +2262,7 @@ void Shutdown() else db_save(ServerProgsDB, strcat("server.db", autocvar_sessionid)); } - if(autocvar_developer) + if(autocvar_developer > 0) { if(autocvar_sv_db_saveasdump) db_dump(TemporaryDB, "server-temp.db");