]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/campaign_balance_fix' into 'master'
authorMario <mario.mario@y7mail.com>
Sat, 28 Dec 2019 13:40:52 +0000 (13:40 +0000)
committerMario <mario.mario@y7mail.com>
Sat, 28 Dec 2019 13:40:52 +0000 (13:40 +0000)
Campaign balance fix

Closes #2364

See merge request xonotic/xonotic-data.pk3dir!742

43 files changed:
.tx/merge-base
common.el.po
gamemodes-server.cfg
qcsrc/client/autocvars.qh
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/command/generic.qc
qcsrc/common/command/reg.qh
qcsrc/common/command/rpn.qc
qcsrc/common/debug.qh
qcsrc/common/effects/effectinfo.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/effects/qc/globalsound.qh
qcsrc/common/items/all.qh
qcsrc/common/items/inventory.qh
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/mutators/mutator/walljump/walljump.qc
qcsrc/common/notifications/all.qh
qcsrc/common/playerstats.qc
qcsrc/common/playerstats.qh
qcsrc/common/turrets/all.qh
qcsrc/common/util.qc
qcsrc/common/weapons/all.qh
qcsrc/lib/log.qh
qcsrc/lib/matrix/command.qc
qcsrc/lib/oo.qh
qcsrc/lib/replicate.qh
qcsrc/lib/static.qh
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/dialog_quit.qc
qcsrc/menu/xonotic/dialog_settings_audio.qc
qcsrc/menu/xonotic/dialog_settings_effects.qc
qcsrc/menu/xonotic/dialog_settings_misc.qc
qcsrc/menu/xonotic/dialog_settings_video.qc
qcsrc/menu/xonotic/slider_particles.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/client.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_world.qc
xonotic-client.cfg
xonotic-server.cfg

index 249da913339d42b751c0a2e1cbce7859e813b386..df5f27c1baedba93172f925a324e6ccc1995d9de 100644 (file)
@@ -1 +1 @@
-Thu Dec 19 07:25:06 CET 2019
+Sat Dec 28 07:24:50 CET 2019
index c32867dc4cf0b81fd6e3f8f46a498a6a25a06079..f7b0135c1fdb9afef381b5bd83c0abc7d6104886 100644 (file)
@@ -12,7 +12,7 @@
 # MasterWord, 2016
 # Mensious Mensious <ektoras@tutanota.com>, 2018-2019
 # Vindex <kon14.inside@gmail.com>, 2014
-# Γιάννης Ανθυμίδης, 2011-2012
+# Yannis Anthymidis, 2011-2012
 msgid ""
 msgstr ""
 "Project-Id-Version: Xonotic\n"
index 6d8ee6f07364532ee1ecb47cc6e051b8a4181823..cd71ecec0ee51d59ce45d0084598e74dbd826d44 100644 (file)
@@ -29,7 +29,9 @@ alias sv_hook_gamestart_ka
 alias sv_hook_gamestart_ft
 alias sv_hook_gamestart_inv
 alias sv_hook_gamestart_duel
-alias sv_hook_gamerestart
+// there is currently no hook for when the match is restarted
+// see sv_hook_readyrestart for previous uses of this hook
+//alias sv_hook_gamerestart
 alias sv_hook_gameend
 
 
index d11355659aa8071a5795e030b555a01361aeeb8b..5793cd5a7b4de75d162cee50e7844438d59be4be 100644 (file)
@@ -70,8 +70,8 @@ bool autocvar_cl_spawn_event_particles;
 bool autocvar_cl_spawn_event_sound = 1;
 // float autocvar_cl_spawn_point_model;
 bool autocvar_cl_spawn_point_particles;
-float autocvar_cl_spawn_point_dist_min = 1200;
-float autocvar_cl_spawn_point_dist_max = 1600;
+float autocvar_cl_spawn_point_dist_min = 800;
+float autocvar_cl_spawn_point_dist_max = 1200;
 bool autocvar_cl_spawnzoom = 1;
 float autocvar_cl_spawnzoom_speed = 1;
 float autocvar_cl_spawnzoom_factor = 2;
index b61f425aa6da44b8d9d4f073a7929275f54a5685..b7b7e530371b9430a90621262fd34c7ba453f6c2 100644 (file)
@@ -240,7 +240,7 @@ void Shutdown()
 bool SetTeam(entity o, int Team)
 {
        TC(int, Team);
-       devassert_once(Team);
+       //devassert_once(Team);
        entity tm;
        if(teamplay)
        {
index 4b8bc4899a788de78152dec7a1990b56a1de01c0..3ff112ffe3d30a7364e08560491806778d7439fe 100644 (file)
@@ -780,7 +780,7 @@ void UpdateDamage()
        if (damage_dealt_time != damage_dealt_time_prev)
        {
                unaccounted_damage += unaccounted_damage_new;
-               LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")");
+               //LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")");
        }
        damage_dealt_time_prev = damage_dealt_time;
 
@@ -829,7 +829,7 @@ void HitSound()
                                pitch_shift = mirror_value + (mirror_value - pitch_shift);
                        }
 
-                       LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift));
+                       //LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift));
 
                        // todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary
                        // todo: normalize sound pressure levels? seems unnecessary
index dcd8d958422b660a941e639fbb23d6eb82de838a..2c34fea44a50813493007c2c2cedc1f88840025a 100644 (file)
@@ -169,7 +169,7 @@ void GenericCommand_qc_curl(int request, int argc)
        }
 }
 
-GENERIC_COMMAND(dumpcommands, "Dump all commands on the program to <program>_cmd_dump.txt")
+GENERIC_COMMAND(dumpcommands, "Dump all commands on the program to <program>_cmd_dump.txt", false)
 {
        switch(request)
        {
@@ -532,16 +532,16 @@ void GenericCommand_(int request)
 */
 
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-GENERIC_COMMAND(addtolist, "Add a string to a cvar") { GenericCommand_addtolist(request, arguments); }
-GENERIC_COMMAND(maplist, "Automatic control of maplist") { GenericCommand_maplist(request, arguments); }
-GENERIC_COMMAND(nextframe, "Execute the given command next frame of this VM") { GenericCommand_nextframe(request, command); }
-GENERIC_COMMAND(qc_curl, "Queries a URL") { GenericCommand_qc_curl(request, arguments); }
-GENERIC_COMMAND(removefromlist, "Remove a string from a cvar") { GenericCommand_removefromlist(request, arguments); }
-GENERIC_COMMAND(restartnotifs, "Re-initialize all notifications") { GenericCommand_restartnotifs(request); }
-GENERIC_COMMAND(rpn, "RPN calculator") { GenericCommand_rpn(request, arguments, command); }
-GENERIC_COMMAND(settemp, "Temporarily set a value to a cvar which is restored later") { GenericCommand_settemp(request, arguments); }
-GENERIC_COMMAND(settemp_restore, "Restore all cvars set by settemp command") { GenericCommand_settemp_restore(request); }
-GENERIC_COMMAND(runtest, "Run unit tests") { GenericCommand_runtest(request, arguments); }
+GENERIC_COMMAND(addtolist, "Add a string to a cvar", true) { GenericCommand_addtolist(request, arguments); }
+GENERIC_COMMAND(maplist, "Automatic control of maplist", true) { GenericCommand_maplist(request, arguments); }
+GENERIC_COMMAND(nextframe, "Execute the given command next frame of this VM", true) { GenericCommand_nextframe(request, command); }
+GENERIC_COMMAND(qc_curl, "Queries a URL", true) { GenericCommand_qc_curl(request, arguments); }
+GENERIC_COMMAND(removefromlist, "Remove a string from a cvar", true) { GenericCommand_removefromlist(request, arguments); }
+GENERIC_COMMAND(restartnotifs, "Re-initialize all notifications", false) { GenericCommand_restartnotifs(request); }
+GENERIC_COMMAND(rpn, "RPN calculator", true) { GenericCommand_rpn(request, arguments, command); }
+GENERIC_COMMAND(settemp, "Temporarily set a value to a cvar which is restored later", false) { GenericCommand_settemp(request, arguments); }
+GENERIC_COMMAND(settemp_restore, "Restore all cvars set by settemp command", false) { GenericCommand_settemp_restore(request); }
+GENERIC_COMMAND(runtest, "Run unit tests", false) { GenericCommand_runtest(request, arguments); }
 
 void GenericCommand_macro_help()
 {
index 9868e2490afc54a4affeedf5216b4782d402f188..a6f669fd91e04c461a2710837ae760e070c9523a 100644 (file)
@@ -6,14 +6,17 @@ REGISTRY(GENERIC_COMMANDS, BITS(7))
 REGISTER_REGISTRY(GENERIC_COMMANDS)
 REGISTRY_SORT(GENERIC_COMMANDS)
 
-#define GENERIC_COMMAND(id, description) \
+.bool m_menubased; // switch to tell whether this alias should be registered as a menu or client based command
+
+#define GENERIC_COMMAND(id, description, menubased) \
        CLASS(genericcommand_##id, Command) \
                ATTRIB(genericcommand_##id, m_name, string, #id); \
        ATTRIB(genericcommand_##id, m_description, string, description); \
+       ATTRIB(genericcommand_##id, m_menubased, bool, menubased); \
        ENDCLASS(genericcommand_##id) \
     REGISTER(GENERIC_COMMANDS, CMD_G, id, m_id, NEW(genericcommand_##id)); \
        METHOD(genericcommand_##id, m_invokecmd, void(genericcommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(GENERIC_COMMANDS_aliases) {
-       FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svmenu")));
+       FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, ((it.m_menubased) ? "qc_cmd_svmenu" : "qc_cmd_svcl"))));
 }
index 0998fad9dbd4ea4ea02ed815840ff18a8b3f548f..4165d3dddac289b34a2ffc42ed9f09dccd259b8b 100644 (file)
@@ -53,6 +53,12 @@ float rpn_popf() { return stof(rpn_pop()); }
 void rpn_pushf(float f) { return rpn_push(sprintf("%.9g", f)); }
 void rpn_setf(float f) { return rpn_set(sprintf("%.9g", f)); }
 
+SHUTDOWN(_rpndb)
+{
+       if(rpn_db)
+               db_close(rpn_db);
+}
+
 void GenericCommand_rpn(int request, int argc, string command)
 {
        switch(request)
index 05064ca96742c395ab0beb863f6bffb186549867..c95bb2d73cf95e458a66485679e06b74f79357e5 100644 (file)
@@ -197,7 +197,7 @@ bool autocvar_debugdraw;
 #endif
 
 
-GENERIC_COMMAND(bufstr_get, "Examine a string buffer object")
+GENERIC_COMMAND(bufstr_get, "Examine a string buffer object", false)
 {
        switch (request)
        {
@@ -219,7 +219,7 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object")
 }
 
 
-GENERIC_COMMAND(version, "Print the current version")
+GENERIC_COMMAND(version, "Print the current version", false)
 {
        switch (request)
        {
@@ -241,7 +241,7 @@ GENERIC_COMMAND(version, "Print the current version")
 #ifdef CSQC
 void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
 #endif
-GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars")
+GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars", false)
 {
        switch (request)
        {
@@ -332,7 +332,7 @@ STATIC_INIT(TRACE_ENT)
 #endif
 
 
-GENERIC_COMMAND(find, "Search through entities for matching classname")
+GENERIC_COMMAND(find, "Search through entities for matching classname", false)
 {
        switch (request)
        {
@@ -363,7 +363,7 @@ GENERIC_COMMAND(find, "Search through entities for matching classname")
 }
 
 
-GENERIC_COMMAND(findat, "Search through entities for matching origin")
+GENERIC_COMMAND(findat, "Search through entities for matching origin", false)
 {
        switch (request)
        {
index 68c245db4a7df2674b7ceb79ddd061234b3ff7fd..79d31eb46bc5efdb473e4322a02b985101511401 100644 (file)
@@ -285,7 +285,7 @@ void effectinfo_dump(int fh, bool alsoprint)
     #undef WRITE
 }
 
-GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
+GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt", false)
 {
     switch (request) {
         case CMD_REQUEST_COMMAND: {
index 4653f4a956084108ac62bc36e9eb4b006389da1e..9fc46ff67537b6cbf42d9a33e03e467feda2772b 100644 (file)
                                if (GetPlayerSoundSampleField_notFound) field = GetVoiceMessageSampleField(key);
                                if (GetPlayerSoundSampleField_notFound)
                                {
-                                       LOG_TRACEF("Invalid sound info field: %s", key);
+                                       LOG_TRACEF("Invalid sound info field in player sound file '%s': %s", f, key);
                                        continue;
                                }
                                string file = argv(1);
index 8b1570f030053124aae84b13ee04ba92394ff471..b5631ed5fd246774277adb823dae760d31700b9d 100644 (file)
@@ -40,11 +40,11 @@ REGISTER_PLAYERSOUND(pain75)
 
 .bool instanceOfVoiceMessage;
 .int m_playersoundvt;
-#define REGISTER_VOICEMSG(id, vt) \
+#define REGISTER_VOICEMSG(id, vt, listed) \
        .string _playersound_##id; \
        REGISTER(PlayerSounds, playersound, id, m_id, new_pure(VoiceMessage)) \
        { \
-               this.instanceOfVoiceMessage = true; \
+               this.instanceOfVoiceMessage = listed; \
                this.m_playersoundstr = #id; \
                this.m_playersoundfld = _playersound_##id; \
                this.m_playersoundvt = vt; \
@@ -57,30 +57,30 @@ const int VOICETYPE_LASTATTACKER_ONLY = 13;
 const int VOICETYPE_AUTOTAUNT = 14;
 const int VOICETYPE_TAUNT = 15;
 
-REGISTER_VOICEMSG(attack, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(attackinfive, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(coverme, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(defend, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(freelance, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(incoming, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(meet, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(needhelp, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(seenflag, VOICETYPE_TEAMRADIO)
-REGISTER_VOICEMSG(taunt, VOICETYPE_TAUNT)
-REGISTER_VOICEMSG(teamshoot, VOICETYPE_LASTATTACKER)
-
-// reserved sound names for the future (some models lack sounds for them):
-// _VOICEMSG(flagcarriertakingdamage)
-// _VOICEMSG(getflag)
-// reserved sound names for the future (ALL models lack sounds for them):
-// _VOICEMSG(affirmative)
-// _VOICEMSG(attacking)
-// _VOICEMSG(defending)
-// _VOICEMSG(roaming)
-// _VOICEMSG(onmyway)
-// _VOICEMSG(droppedflag)
-// _VOICEMSG(negative)
-// _VOICEMSG(seenenemy)
+REGISTER_VOICEMSG(attack, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(attackinfive, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(coverme, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(defend, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(freelance, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(incoming, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(meet, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(needhelp, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(seenflag, VOICETYPE_TEAMRADIO, true)
+REGISTER_VOICEMSG(taunt, VOICETYPE_TAUNT, true)
+REGISTER_VOICEMSG(teamshoot, VOICETYPE_LASTATTACKER, true)
+
+//NOTE: some models lack sounds for these:
+REGISTER_VOICEMSG(flagcarriertakingdamage, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(getflag, VOICETYPE_TEAMRADIO, false)
+//NOTE: ALL models lack sounds for these (only available in default sounds currently):
+REGISTER_VOICEMSG(affirmative, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(attacking, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(defending, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(roaming, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(onmyway, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(droppedflag, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(negative, VOICETYPE_TEAMRADIO, false)
+REGISTER_VOICEMSG(seenenemy, VOICETYPE_TEAMRADIO, false)
 
 .string m_globalsoundstr;
 REGISTRY(GlobalSounds, BITS(8) - 1)
index 3ff4a54155a3cccaf0ea91b69a38a02ac90c15dc..3ae473503db46e24d8f8877a2fb05cd998142082 100644 (file)
@@ -19,7 +19,7 @@ STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
 
 void Dump_Items();
 
-GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
+GENERIC_COMMAND(dumpitems, "Dump all items to the console", false) {
     switch (request) {
         case CMD_REQUEST_COMMAND: {
             Dump_Items();
index 017ada75c0288df84ce093b80dffefa8316a810c..9f0a43a0750959f08d1847886e09e88ea017673d 100644 (file)
@@ -42,7 +42,7 @@ NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
             .int fld = inv_items[it.m_id];
             int prev = this.(fld);
             int next = this.(fld) = ReadByte();
-            LOG_TRACEF("%s: %.0f -> %.0f", it.m_name, prev, next);
+            LOG_DEBUGF("%s: %.0f -> %.0f", it.m_name, prev, next);
         }
     }
     return true;
index b684af15255e66efc70d9580e34f90c3dea825f4..d9a51c05e9a4649718deac200f0e5f4beeff9b6a 100644 (file)
@@ -66,6 +66,7 @@ METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity
                        actor.anim_finished = time + 1;
                }
         if (isPlayer) actor.enemy = Monster_FindTarget(actor);
+        monster_makevectors(actor, actor.enemy);
         W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_SpiderAttack_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_SPIDER.m_id);
        if (!isPlayer) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
                M_Spider_Attack_Web(actor);
index d07669af0ea1861edcb230d86cc27cb151b5d8d7..4de122e8494419205178cc87dc74f77957699c7f 100644 (file)
@@ -18,6 +18,7 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity
     TC(WyvernAttack, thiswep);
     if (fire & 1)
     if (time > actor.attack_finished_single[0] || weapon_prepareattack(thiswep, actor, weaponentity, false, 1.2)) {
+       monster_makevectors(actor, actor.enemy);
         if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_WyvernAttack_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_WYVERN.m_id);
                if (IS_MONSTER(actor)) {
                        actor.attack_finished_single[0] = time + 1.2;
index c462a7e2b7c869398e733019a107f69049d16472..46e18059c8a8dba9f9f8e71433d14950ad9476f7 100644 (file)
@@ -21,12 +21,15 @@ vector PlayerTouchWall(entity this)
        if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)) \
                return trace_plane_normal;
 
+       vector forward, right, up;
+       MAKE_VECTORS(this.angles, forward, right, up);
+
        float dist = 10, max_normal = 0.2, scaler = 100;
        vector start = this.origin;
-       TRACE(start + v_forward * scaler)
-       TRACE(start - v_forward * scaler)
-       TRACE(start + v_right * scaler)
-       TRACE(start - v_right * scaler)
+       TRACE(start + forward * scaler)
+       TRACE(start - forward * scaler)
+       TRACE(start + right * scaler)
+       TRACE(start - right * scaler)
 #undef TRACE
        return '0 0 0';
 }
index ee39b1881ab100937221ae3604d1cac68bb817ae..7c341293b958fba3bc963d59eaa65f727553ec79 100644 (file)
@@ -160,7 +160,7 @@ void Create_Notification_Entity_Choice(entity notif,
 
 void Dump_Notifications(int fh, bool alsoprint);
 
-GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt")
+GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt", false)
 {
        switch (request)
        {
@@ -864,8 +864,8 @@ REGISTRY_END(Notifications)
 void ReplicateVars(bool would_destroy)
 {
        if (!would_destroy)
-               FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
-                       string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
+               FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
+                       string cvarname = strcat("notification_", Get_Notif_CvarName(it));
                        // NOTE: REPLICATE_SIMPLE can return;
                        REPLICATE_SIMPLE(it.cvar_value, cvarname);
                });
index cf272e5635a1eb66e72ec90810b864b10eff9f27..511ac46e66eedc7a8b35ce447b328b56f1a89ff7 100644 (file)
@@ -490,6 +490,21 @@ void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
        }
 }
 
+SHUTDOWN(PlayerStats_PlayerBasic_Shutdown)
+{
+       if(PS_B_IN_DB >= 0)
+       {
+               db_close(PS_B_IN_DB);
+               PS_B_IN_DB = -1;
+       }
+
+       if(PS_GR_OUT_DB >= 0)
+       {
+               db_close(PS_GR_OUT_DB);
+               PS_GR_OUT_DB = -1;
+       }
+}
+
 void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer)
 {
        // determine whether we should retrieve playerbasic information again
index d27dd0ed1f775038bb904e57327876a84d45314d..d41a097d6d642419ecd4f8218e071774ca516f47 100644 (file)
@@ -4,7 +4,7 @@
 //float PS_PM_IN_DB = -1;   // playerstats_prematch_in_db      // db for info COLLECTED at the beginning of a match
 int PS_GR_OUT_DB = -1;  // playerstats_gamereport_out_db   // db of info SENT at the end of a match
 //float PS_GR_IN_DB = -1;   // playerstats_gamereport_in_db    // db for info COLLECTED at the end of a match
-int PS_B_IN_DB = -1;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
+float PS_B_IN_DB = -1;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
 #endif
 
 #ifdef MENUQC
index 3d0528a2511825742d89fd27ac0ecfc727a1d440..9dedc89cb780253a184b45ed3f1dba2da1744d9b 100644 (file)
@@ -57,7 +57,7 @@ REGISTRY_CHECK(Turrets)
        #define TR_CONFIG_END()
 #endif
 
-GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
+GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt", false)
 {
     switch(request)
     {
index d9b9efcde36444c8d06b804b5dd60ad80c0ec237..3b7513013dc036475976c872d628ec572d8a4b67 100644 (file)
@@ -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)
index 0be413f0fb0071fad8974f2022e50cea7a1bf838..131e7b49efa03a21044d505f157f768cea70ad47 100644 (file)
@@ -38,7 +38,7 @@ STATIC_INIT(WeaponPickup) { FOREACH(Weapons, true, it.m_pickup = NEW(WeaponPicku
 #define WepSet_FromWeapon(it) ((it).m_wepset)
 WepSet _WepSet_FromWeapon(int i);
 
-GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPONTODO: make this work with other progs than just server
+GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt", false) // WEAPONTODO: make this work with other progs than just server
 {
     switch(request)
     {
index 94a58d0ca486636e9a917429b677f4aeb726f204..16875c8bc3e233224cc484b49a8efa63ed5f4932 100644 (file)
@@ -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 \
index 1b58eb1b9fcf75d0ddd7196843a6cb5be402d695..0cfe564f0792461ed0264663041eae2340cdc5f8 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <common/command/_mod.qh>
 
-GENERIC_COMMAND(mx, "Send a matrix command") {
+GENERIC_COMMAND(mx, "Send a matrix command", false) {
     switch (argv(1)) {
         case "user":
             strcpy(matrix_user, substring(command, argv_start_index(2), -1));
index 9abeb1bcce330e1e20ede401e5e624c2d0370eae..70e17e6cf0b2ddc9146c3bbf52fec8d0d88f078b 100644 (file)
@@ -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)
                        {
index a88bde462934134f3585707eff76e81303e8d6c2..31177426066b5b1a78b6ea9cf3b271caad0bd74d 100644 (file)
                        }
 
                #define REPLICATE_SIMPLE(field, cvarname) MACRO_BEGIN \
-                       if (ReplicateVars_NOT_SENDING() && field != cvar(cvarname)) \
+                       if (ReplicateVars_NOT_SENDING()) \
                        { \
-                               localcmd(strcat("cl_cmd sendcvar ", cvarname, "\n")); \
-                               ReplicateVars_DELAY_1FRAME(); \
-                               field = cvar(cvarname); \
-                               return; \
+                               float thecvar = cvar(cvarname); \
+                               if(field != thecvar) \
+                               { \
+                                       localcmd(strcat("cl_cmd sendcvar ", cvarname, "\n")); \
+                                       ReplicateVars_DELAY_1FRAME(); \
+                                       field = thecvar; \
+                                       return; \
+                               } \
                        } \
                MACRO_END
        #endif
index e0ec96b8ec0c43872992e12523329c0be74e8f5d..e1879890e8521dfe9c5173c209aee501c89da628 100644 (file)
@@ -17,8 +17,8 @@ void profile(string s)
 }
 
 #define _STATIC_INIT(func, where) \
-       ACCUMULATE void _static_##func##profile() { profile(#func); } \
-       ACCUMULATE_FUNCTION(where, _static_##func##profile) \
+       /* ACCUMULATE void _static_##func##profile() { profile(#func); } */ \
+       /* ACCUMULATE_FUNCTION(where, _static_##func##profile) */ \
        ACCUMULATE void _static_##func(); \
        ACCUMULATE_FUNCTION(where, _static_##func) \
        void _static_##func()
index f195574449379ceec441847d1605267878b38789..891235def666700cc2a0865d8809d9512a1b43ac 100644 (file)
@@ -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)
                {
index e68b967a0f69a06b888beb214920dbcfd6373eac..3f5b18712ea8263b277e72a4624a2ae0af65dd21 100644 (file)
@@ -11,7 +11,7 @@ void XonoticQuitDialog_fill(entity me)
                me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to quit?")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCommandButton_T(_("Yes"), '1 0 0', "echo ]quit\nquit", 0,
+               me.TD(me, 1, 1, e = makeXonoticCommandButton_T(_("Yes"), '1 0 0', "echo ]quitquit", 0,
                        _("Back to work...")));
                me.TD(me, 1, 1, e = makeXonoticButton_T(_("No"), '0 1 0',
                        _("I got some more fragging to do!")));
index 7af8c550032b3dec7e6368f19b6ada4cfe8099d7..1f8c6d81cffc6cb9f8460358a67a2b2f35075412 100644 (file)
@@ -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);
index a9375327ec2e9735b2ea65db1e1632cc44edc5e1..1776ed4798fc9fe37c09a4d1baaa36ed80175ad7 100644 (file)
@@ -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"),
index 11e6ca2b5ab1ddbb5490209789c662c41cba9cb2..1033919f4f7a2e3ce2490c7444512c2670a20b65 100644 (file)
@@ -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"));
index 0e524b6e23852cedf80e6c5c3e66e3841ac430ef..305567b7d7b5b01a0a87dd6ca4a42ef5b3ebdc6a 100644 (file)
@@ -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)")));
index 72639fcb1ca93ddd504d34c262d3a5d8854ace78..5e2b1bf81785df0b4f9189345b7d9f718567a1a1 100644 (file)
@@ -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)
index c203a93030a6e986ca646ee5298a9cf6ba891c36..a126b9e5da2713f68fc1cf4f952950a035aadec8 100644 (file)
@@ -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;
index 7a40f18e8df56f6e1eacf6e0f242b08b316ee9e6..c09d8f81d4fc927bdabe934b27ac86a9e0f3dcab 100644 (file)
@@ -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");
index 98616a76341f76ac901e838fdd7b81cb39478911..3b74ae30320479e52091c762ef8591dacccbae85 100644 (file)
@@ -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);
        }
index b611ab2665896975ab0b4ce15c24da2480f61190..90073beaaa2273e33a876264a85358aa71ac1b4e 100644 (file)
@@ -477,7 +477,7 @@ void ReadyRestart_force()
 void ReadyRestart()
 {
        if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || game_stopped || race_completing) localcmd("restart\n");
-       else localcmd("\nsv_hook_gamerestart\n");
+       else localcmd("\nsv_hook_readyrestart\n");
 
        // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
        // Otherwise scores could be manipulated during the countdown.
index 0c44a95f17bf5385372fb106e1dd4e37114930ee..f739533fc8b9abf20732fc7da4b9ed3810edf083 100644 (file)
@@ -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");
index 94fcdfc3ebf01376ee4242d3120a8e66cdd0f913..fe08cabdd7f7745fefed87e7defb92dcaa2306bb 100644 (file)
@@ -67,8 +67,8 @@ seta cl_spawn_event_particles 1 "pointparticles effect whenever a player spawns"
 seta cl_spawn_event_sound 1 "sound effect whenever a player spawns"
 //seta cl_spawn_point_model 0 "place a model at all spawn points" // still needs a model
 seta cl_spawn_point_particles 1 "pointparticles effect at all spawn points" // managed by effects-.cfg files
-seta cl_spawn_point_dist_min 1200
-seta cl_spawn_point_dist_max 1600
+seta cl_spawn_point_dist_min 800
+seta cl_spawn_point_dist_max 1200
 
 freelook 1
 sensitivity 6
index 4e9685ba43e4e254a97925dbd721d733c3165d25..fad9b90f611fc6380b01ea28337f827a6a23749b 100644 (file)
@@ -19,6 +19,8 @@ set sv_ready_restart 0 "allow a map to be restarted once all players pressed the
 set sv_ready_restart_after_countdown 0 "reset players and map items after the countdown ended, instead of at the beginning of the countdown"
 set sv_ready_restart_repeatable 0 "allows the players to restart the game as often as needed"
 
+alias sv_hook_readyrestart
+
 //nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
 set teamplay_lockonrestart 0 "lock teams once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"