]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/quickmenu
authorterencehill <piuntn@gmail.com>
Wed, 25 Feb 2015 18:14:07 +0000 (19:14 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 25 Feb 2015 18:14:07 +0000 (19:14 +0100)
90 files changed:
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
balance-xonotic.cfg
balance-xpm.cfg
crosshairs.cfg
defaultXonotic.cfg
gfx/crosshair29.tga [deleted file]
gfx/crosshair30.tga [deleted file]
gfx/crosshair31.tga
gfx/crosshair32.tga
gfx/crosshair33.tga
gfx/crosshair34.tga
gfx/crosshair35.tga
gfx/crosshair36.tga
gfx/crosshair37.tga
gfx/crosshair38.tga
gfx/crosshair39.tga
gfx/crosshair40.tga
gfx/crosshair41.tga
gfx/crosshair42.tga
gfx/crosshair43.tga [new file with mode: 0644]
gfx/crosshair44.tga [new file with mode: 0644]
gfx/crosshair45.tga [new file with mode: 0644]
gfx/crosshair46.tga [new file with mode: 0644]
gfx/crosshair47.tga [new file with mode: 0644]
gfx/crosshair48.tga [new file with mode: 0644]
gfx/crosshair49.tga [new file with mode: 0644]
gfx/crosshair50.tga [new file with mode: 0644]
gfx/crosshair51.tga [new file with mode: 0644]
gfx/crosshair52.tga [new file with mode: 0644]
gfx/crosshair53.tga [new file with mode: 0644]
gfx/crosshair54.tga [new file with mode: 0644]
gfx/crosshair55.tga [new file with mode: 0644]
gfx/crosshair56.tga [new file with mode: 0644]
gfx/crosshair57.tga [new file with mode: 0644]
gfx/crosshair58.tga [new file with mode: 0644]
gfx/crosshair59.tga [new file with mode: 0644]
gfx/crosshair60.tga [new file with mode: 0644]
gfx/crosshair61.tga [new file with mode: 0644]
gfx/crosshair62.tga [new file with mode: 0644]
gfx/crosshair63.tga [new file with mode: 0644]
gfx/crosshair64.tga [new file with mode: 0644]
gfx/crosshair65.tga [new file with mode: 0644]
gfx/crosshair66.tga [new file with mode: 0644]
gfx/crosshaircalibrate.tga [new file with mode: 0644]
gfx/crosshairdot.tga
gfx/crosshairmoustache.tga [new file with mode: 0644]
gfx/crosshairtuba.tga
mutators.cfg
qcsrc/client/hud.qc
qcsrc/client/tuba.qc
qcsrc/client/tuba.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_rpc.qc
qcsrc/common/weapons/w_vaporizer.qc
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/dpdefs/dpextensions.qh
qcsrc/dpdefs/menudefs.qh
qcsrc/menu/item/modalcontroller.qc
qcsrc/menu/xonotic/dialog_firstrun.qc
qcsrc/menu/xonotic/dialog_multiplayer_create.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_demo_timeconfirm.qc
qcsrc/menu/xonotic/dialog_multiplayer_profile.qc
qcsrc/menu/xonotic/dialog_settings_effects.qc
qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc
qcsrc/menu/xonotic/dialog_settings_game_hud.qc
qcsrc/menu/xonotic/dialog_settings_game_hudconfirm.qc
qcsrc/menu/xonotic/dialog_settings_game_messages.qc
qcsrc/menu/xonotic/dialog_settings_input.qc
qcsrc/menu/xonotic/gametypelist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/cl_client.qc
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/func_breakable.qc
qcsrc/server/ipban.qc
qcsrc/server/target_spawn.qc
qcsrc/warpzonelib/mathlib.qc
qcsrc/warpzonelib/mathlib.qh
xonotic-credits.txt

index 2e6d10e7b1d62b34202c7388d5c74979f0b051ad..1fa36d0c4985fbbb016e532453947a2a692e752c 100644 (file)
@@ -34,12 +34,12 @@ set g_balance_blaster_weaponthrowable 0
 // {{{ #2: Shotgun
 set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
-set g_balance_shotgun_primary_bullets 14
-set g_balance_shotgun_primary_damage 3.5
+set g_balance_shotgun_primary_bullets 12
+set g_balance_shotgun_primary_damage 4
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
-set g_balance_shotgun_primary_spread 0.11
+set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
index 2e6d10e7b1d62b34202c7388d5c74979f0b051ad..1fa36d0c4985fbbb016e532453947a2a692e752c 100644 (file)
@@ -34,12 +34,12 @@ set g_balance_blaster_weaponthrowable 0
 // {{{ #2: Shotgun
 set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
-set g_balance_shotgun_primary_bullets 14
-set g_balance_shotgun_primary_damage 3.5
+set g_balance_shotgun_primary_bullets 12
+set g_balance_shotgun_primary_damage 4
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
-set g_balance_shotgun_primary_spread 0.11
+set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
index 08ff39c0e700f843a9cc44e39c25829b9a5f625f..76ba515256438d98b65dbf5d694a78d121e64029 100644 (file)
@@ -155,7 +155,7 @@ set g_projectiles_damage -2
 // 0: only damage from contents (lava/slime) or exceptions
 // 1: only self damage or damage from contents or exceptions
 // 2: allow all damage to projectiles normally
-set g_projectiles_keep_owner 0
+set g_projectiles_keep_owner 1
 set g_projectiles_newton_style 0
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
index c254bcdf8d5118efd4b5f1aec0d687c609c63388..e7855280edc2b2541c9895ecf5d6fd3a336279c7 100644 (file)
@@ -155,7 +155,7 @@ set g_projectiles_damage -2
 // 0: only damage from contents (lava/slime) or exceptions
 // 1: only self damage or damage from contents or exceptions
 // 2: allow all damage to projectiles normally
-set g_projectiles_keep_owner 0
+set g_projectiles_keep_owner 1
 set g_projectiles_newton_style 0
 // possible values:
 // 0: absolute velocity projectiles (like Quake)
index 4d44688a28c78a5682fade92d6cfa50afeb67745..fb341c5b8537f37c492a2de2c7148ebd39b9b579 100644 (file)
@@ -6,13 +6,13 @@
 seta crosshair 16
 seta crosshair_enabled 1 // main toggle for enabling/disabling crosshair rendering, used mostly just for the menu... 1 = with per-weapon crosshairs, 2 = custom crosshair
 seta crosshair_color "0.6 0.8 1"
-seta crosshair_alpha 0.75
-seta crosshair_size 0.3
+seta crosshair_alpha 0.8
+seta crosshair_size 0.4
 
 // crosshair dot settings
 seta crosshair_dot 0
 seta crosshair_dot_alpha 1
-seta crosshair_dot_size 0.600000
+seta crosshair_dot_size 0.6
 seta crosshair_dot_color "1 0 0"
 seta crosshair_dot_color_custom 1 "use a custom color for the crosshair dot"
 
index 034b3bb32d9df4fe1f3139dad707e1742af9c2c7..f66dc0128bdb87059cb2a4433fb81f8f7365c75a 100644 (file)
@@ -472,7 +472,7 @@ set g_botclip_collisions 1 "0 = disable collision testing against botclips, migh
 set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
 
 set g_spawn_alloweffects 1 "allow clients to enable spawn point and event effects such as particles and sounds, see cl_spawn_ cvars for more info"
-set g_spawn_furthest 0.5 "this amount of the spawns shall be far away from any players"
+set g_spawn_furthest 1.0 "this amount of the spawns shall be far away from any players"
 set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
 // respawn delay
 set g_respawn_delay_small 2 "small game number of seconds you have to wait before you can respawn again"
diff --git a/gfx/crosshair29.tga b/gfx/crosshair29.tga
deleted file mode 100644 (file)
index c103751..0000000
Binary files a/gfx/crosshair29.tga and /dev/null differ
diff --git a/gfx/crosshair30.tga b/gfx/crosshair30.tga
deleted file mode 100644 (file)
index 093bff2..0000000
Binary files a/gfx/crosshair30.tga and /dev/null differ
index c7d59e3871baef29f05006690226656a25bd6365..d9779a13924b864652a915db624859bb178c1871 100644 (file)
Binary files a/gfx/crosshair31.tga and b/gfx/crosshair31.tga differ
index 0dae288c7a32192a2318b370e6738014fc5897dc..c50055477b1c217031b553f18d554605dfad374d 100644 (file)
Binary files a/gfx/crosshair32.tga and b/gfx/crosshair32.tga differ
index b3cc2359750da66867591c16715aa46eebc25d98..39843b41694de4cbaaa63e5e12fb2e8f6a83ca45 100644 (file)
Binary files a/gfx/crosshair33.tga and b/gfx/crosshair33.tga differ
index 9a2257b6297e30f2e08cafaabd8e01ba64e6d9c5..b8d74789db81ca91f2505506bec6b1f0e5cce6d7 100644 (file)
Binary files a/gfx/crosshair34.tga and b/gfx/crosshair34.tga differ
index aaa8c851c0548befcc4d4b09ccc8b7f53b29dccf..c88e5609228c46bd43356e44a73ec4a35ff56286 100644 (file)
Binary files a/gfx/crosshair35.tga and b/gfx/crosshair35.tga differ
index 87f01f262a2cad8d9c11f8b103adc0cc6fef58ae..dae534fa158740462f144c981c7e888be782166f 100644 (file)
Binary files a/gfx/crosshair36.tga and b/gfx/crosshair36.tga differ
index 50ae94bc97bb24979c3f98be1b18e1906256a7d2..06eb4fc700689e6ace8397047d684acef4c52fa5 100644 (file)
Binary files a/gfx/crosshair37.tga and b/gfx/crosshair37.tga differ
index 08e3436c2661ee773da7d0f18fa86b2f0437a431..68d2b54fd0e7cabd6f10fab73faa8b896484eeb8 100644 (file)
Binary files a/gfx/crosshair38.tga and b/gfx/crosshair38.tga differ
index 6a90b620c7c708d8f2563a9f4ba29da8fe547a65..ff1f4fb8b4037660430d71035f91d19e229a1151 100644 (file)
Binary files a/gfx/crosshair39.tga and b/gfx/crosshair39.tga differ
index d15801cf989ef2120d29e4f5b25b009e2cfdffcf..96e11b04363e5908578ae7b3ccb6c2080e86e609 100644 (file)
Binary files a/gfx/crosshair40.tga and b/gfx/crosshair40.tga differ
index 5e11a3c4f585870828bb3b466d32259c50441989..0b610b270d8517e1225af2f14b8c4c6afea5faa3 100644 (file)
Binary files a/gfx/crosshair41.tga and b/gfx/crosshair41.tga differ
index a78503adcdbdd538b9473ff9088e856df3a722af..9401c6a80d76305b284ffabc398814ad4bb4c096 100644 (file)
Binary files a/gfx/crosshair42.tga and b/gfx/crosshair42.tga differ
diff --git a/gfx/crosshair43.tga b/gfx/crosshair43.tga
new file mode 100644 (file)
index 0000000..183d257
Binary files /dev/null and b/gfx/crosshair43.tga differ
diff --git a/gfx/crosshair44.tga b/gfx/crosshair44.tga
new file mode 100644 (file)
index 0000000..83716cf
Binary files /dev/null and b/gfx/crosshair44.tga differ
diff --git a/gfx/crosshair45.tga b/gfx/crosshair45.tga
new file mode 100644 (file)
index 0000000..4142558
Binary files /dev/null and b/gfx/crosshair45.tga differ
diff --git a/gfx/crosshair46.tga b/gfx/crosshair46.tga
new file mode 100644 (file)
index 0000000..34f9ffd
Binary files /dev/null and b/gfx/crosshair46.tga differ
diff --git a/gfx/crosshair47.tga b/gfx/crosshair47.tga
new file mode 100644 (file)
index 0000000..2221887
Binary files /dev/null and b/gfx/crosshair47.tga differ
diff --git a/gfx/crosshair48.tga b/gfx/crosshair48.tga
new file mode 100644 (file)
index 0000000..31d58db
Binary files /dev/null and b/gfx/crosshair48.tga differ
diff --git a/gfx/crosshair49.tga b/gfx/crosshair49.tga
new file mode 100644 (file)
index 0000000..ee6b145
Binary files /dev/null and b/gfx/crosshair49.tga differ
diff --git a/gfx/crosshair50.tga b/gfx/crosshair50.tga
new file mode 100644 (file)
index 0000000..0785a4d
Binary files /dev/null and b/gfx/crosshair50.tga differ
diff --git a/gfx/crosshair51.tga b/gfx/crosshair51.tga
new file mode 100644 (file)
index 0000000..7da16bc
Binary files /dev/null and b/gfx/crosshair51.tga differ
diff --git a/gfx/crosshair52.tga b/gfx/crosshair52.tga
new file mode 100644 (file)
index 0000000..9449478
Binary files /dev/null and b/gfx/crosshair52.tga differ
diff --git a/gfx/crosshair53.tga b/gfx/crosshair53.tga
new file mode 100644 (file)
index 0000000..eb74110
Binary files /dev/null and b/gfx/crosshair53.tga differ
diff --git a/gfx/crosshair54.tga b/gfx/crosshair54.tga
new file mode 100644 (file)
index 0000000..46d0464
Binary files /dev/null and b/gfx/crosshair54.tga differ
diff --git a/gfx/crosshair55.tga b/gfx/crosshair55.tga
new file mode 100644 (file)
index 0000000..adf1950
Binary files /dev/null and b/gfx/crosshair55.tga differ
diff --git a/gfx/crosshair56.tga b/gfx/crosshair56.tga
new file mode 100644 (file)
index 0000000..61adf9a
Binary files /dev/null and b/gfx/crosshair56.tga differ
diff --git a/gfx/crosshair57.tga b/gfx/crosshair57.tga
new file mode 100644 (file)
index 0000000..d0d9220
Binary files /dev/null and b/gfx/crosshair57.tga differ
diff --git a/gfx/crosshair58.tga b/gfx/crosshair58.tga
new file mode 100644 (file)
index 0000000..0bdb7f9
Binary files /dev/null and b/gfx/crosshair58.tga differ
diff --git a/gfx/crosshair59.tga b/gfx/crosshair59.tga
new file mode 100644 (file)
index 0000000..8e48aa2
Binary files /dev/null and b/gfx/crosshair59.tga differ
diff --git a/gfx/crosshair60.tga b/gfx/crosshair60.tga
new file mode 100644 (file)
index 0000000..c03e19d
Binary files /dev/null and b/gfx/crosshair60.tga differ
diff --git a/gfx/crosshair61.tga b/gfx/crosshair61.tga
new file mode 100644 (file)
index 0000000..507853f
Binary files /dev/null and b/gfx/crosshair61.tga differ
diff --git a/gfx/crosshair62.tga b/gfx/crosshair62.tga
new file mode 100644 (file)
index 0000000..54031b1
Binary files /dev/null and b/gfx/crosshair62.tga differ
diff --git a/gfx/crosshair63.tga b/gfx/crosshair63.tga
new file mode 100644 (file)
index 0000000..1aa5d55
Binary files /dev/null and b/gfx/crosshair63.tga differ
diff --git a/gfx/crosshair64.tga b/gfx/crosshair64.tga
new file mode 100644 (file)
index 0000000..06893f8
Binary files /dev/null and b/gfx/crosshair64.tga differ
diff --git a/gfx/crosshair65.tga b/gfx/crosshair65.tga
new file mode 100644 (file)
index 0000000..ebf77c3
Binary files /dev/null and b/gfx/crosshair65.tga differ
diff --git a/gfx/crosshair66.tga b/gfx/crosshair66.tga
new file mode 100644 (file)
index 0000000..ccba58d
Binary files /dev/null and b/gfx/crosshair66.tga differ
diff --git a/gfx/crosshaircalibrate.tga b/gfx/crosshaircalibrate.tga
new file mode 100644 (file)
index 0000000..3abd29e
Binary files /dev/null and b/gfx/crosshaircalibrate.tga differ
index 143a372f8c4ea9dec113759d80f93147d577f518..eef0af18d7f3e2b791faf141b129c5e01a83bff2 100644 (file)
Binary files a/gfx/crosshairdot.tga and b/gfx/crosshairdot.tga differ
diff --git a/gfx/crosshairmoustache.tga b/gfx/crosshairmoustache.tga
new file mode 100644 (file)
index 0000000..0d2129f
Binary files /dev/null and b/gfx/crosshairmoustache.tga differ
index 6386052d5ebd1a2dd98f5e112528564eecd20a6c..fcd0337ce9e913cd773bf92fb4efb2b6dd7b4b91 100644 (file)
Binary files a/gfx/crosshairtuba.tga and b/gfx/crosshairtuba.tga differ
index be5af23f9c1ad9f6e2950369c28f5275abab9447..a803d8411011cb7e52f737bd6b0553eaa6cee958 100644 (file)
@@ -43,7 +43,7 @@ set g_overkill_100h_anyway 1
 set g_overkill_powerups_replace 1
 set g_overkill_superguns_respawn_time 20
 
-set g_overkill_ammo_charge 1
+set g_overkill_ammo_charge 0
 set g_overkill_ammo_charge_notice 1
 set g_overkill_ammo_charge_limit 1
 set g_overkill_ammo_charge_rate 0.5
index 41f2c8e40a7b10fe375654fa3f2cbf49a8a9316f..cc4bc83d67cdc711470a213814e14c5934f594d4 100644 (file)
@@ -140,6 +140,12 @@ vector HUD_Get_Num_Color (float x, float maxvalue)
        return color;
 }
 
+float HUD_GetRowCount(float item_count, vector size, float item_aspect)
+{
+       float aspect = size_y / size_x;
+       return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) / 2), item_count);
+}
+
 float stringwidth_colors(string s, vector theSize)
 {
        return stringwidth(s, true, theSize);
@@ -424,16 +430,13 @@ void HUD_Weapons(void)
        float screen_ar;
        vector center = '0 0 0';
        float weapon_count, weapon_id;
-       float row, column, rows = 0, columns = 0;
+       float row, column, rows = 0, columns;
        float aspect = autocvar_hud_panel_weapons_aspect;
 
-       float panel_weapon_accuracy;
-
        float timeout = autocvar_hud_panel_weapons_timeout;
        float timein_effect_length = autocvar_hud_panel_weapons_timeout_speed_in; //? 0.375 : 0);
        float timeout_effect_length = autocvar_hud_panel_weapons_timeout_speed_out; //? 0.75 : 0);
 
-       float ammo_full;
        vector barsize = '0 0 0', baroffset = '0 0 0';
        vector ammo_color = '1 0 1';
        float ammo_alpha = 1;
@@ -497,15 +500,18 @@ void HUD_Weapons(void)
        if(!autocvar_hud_panel_weapons_complainbubble || autocvar__hud_configure || time - complain_weapon_time >= when + fadetime)
                complain_weapon = 0;
 
+       if(autocvar__hud_configure)
+       {
+               if(!weapons_stat)
+                       for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
+                               weapons_stat |= WepSet_FromWeapon(i);
+       }
+
        // determine which weapons are going to be shown
        if (autocvar_hud_panel_weapons_onlyowned)
        {
                if(autocvar__hud_configure)
                {
-                       if (!weapons_stat)
-                               for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
-                                       weapons_stat |= WepSet_FromWeapon(i);
-
                        if(menu_enabled != 2)
                                HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
                }
@@ -513,13 +519,9 @@ void HUD_Weapons(void)
                // do we own this weapon?
                weapon_count = 0;
                for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-                       if(weapons_stat & WepSet_FromWeapon(weaponorder[i].weapon))
+                       if((weapons_stat & WepSet_FromWeapon(weaponorder[i].weapon)) || (weaponorder[i].weapon == complain_weapon))
                                ++weapon_count;
 
-               // add it anyway if weaponcomplain is shown
-               if(complain_weapon)
-                       ++weapon_count;
-
                // might as well commit suicide now, no reason to live ;)
                if (weapon_count == 0)
                {
@@ -527,41 +529,58 @@ void HUD_Weapons(void)
                        return;
                }
 
-               vector max_panel_size = panel_size - '2 2 0' * panel_bg_padding;
+               vector old_panel_size = panel_size;
+               vector padded_panel_size = panel_size - '2 2 0' * panel_bg_padding;
 
-               // calculate distribution and size of table cells
-               if(max_panel_size.x > max_panel_size.y)
-               {
-                       while(weapon_count > columns * rows)
-                       {
-                               ++rows;
-                               columns = ceil(max_panel_size.x / (max_panel_size.y / rows * aspect));
-                       }
+               // get the all-weapons layout
+               rows = HUD_GetRowCount(WEP_COUNT, padded_panel_size, aspect);
+               columns = ceil(WEP_COUNT / rows);
+               weapon_size.x = padded_panel_size.x / columns;
+               weapon_size.y = padded_panel_size.y / rows;
 
-                       weapon_size.x = max_panel_size.x / columns;
-                       weapon_size.y = max_panel_size.y / rows;
+               // reduce rows and columns as needed
+               // NOTE: although weapons should aways look the same even if onlyowned is enabled,
+               // we enlarge them a bit when possible to better match the desired aspect ratio
+               if(padded_panel_size.y > padded_panel_size.x)
+               {
                        columns = ceil(weapon_count / rows);
+                       rows = ceil(weapon_count / columns);
+                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
+                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
                }
                else
                {
-                       while(weapon_count > columns * rows)
-                       {
-                               ++columns;
-                               rows = ceil(max_panel_size.y / (max_panel_size.x / columns / aspect));
-                       }
-
-                       weapon_size.x = max_panel_size.x / columns;
-                       weapon_size.y = max_panel_size.y / rows;
                        rows = ceil(weapon_count / columns);
+                       columns = ceil(weapon_count / rows);
+                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
+                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
                }
 
                // reduce size of the panel
                panel_size.x = columns * weapon_size.x;
                panel_size.y = rows * weapon_size.y;
-               panel_pos.x += (max_panel_size.x - panel_size.x) / 2;
-               panel_pos.y += (max_panel_size.y - panel_size.y) / 2;
-
                panel_size += '2 2 0' * panel_bg_padding;
+
+               // center the resized panel, or snap it to the screen edge when close enough
+               if(panel_pos.x > vid_conwidth * 0.001)
+               {
+                       if(panel_pos.x + old_panel_size.x > vid_conwidth * 0.999)
+                               panel_pos.x += old_panel_size.x - panel_size.x;
+                       else
+                               panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
+               }
+               else if(old_panel_size.x > vid_conwidth * 0.999)
+                       panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
+
+               if(panel_pos.y > vid_conheight * 0.001)
+               {
+                       if(panel_pos.y + old_panel_size.y > vid_conheight * 0.999)
+                               panel_pos.y += old_panel_size.y - panel_size.y;
+                       else
+                               panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
+               }
+               else if(old_panel_size.y > vid_conheight * 0.999)
+                       panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
        }
        else
                weapon_count = WEP_COUNT;
@@ -672,8 +691,7 @@ void HUD_Weapons(void)
 
        if(!rows) // if rows is > 0 onlyowned code has already updated these vars
        {
-               rows = panel_size.y/panel_size.x;
-               rows = bound(1, floor((sqrt(4 * aspect * rows * weapon_count + rows * rows) + rows + 0.5) / 2), weapon_count);
+               rows = HUD_GetRowCount(weapon_count, panel_size, aspect);
                columns = ceil(weapon_count/rows);
                weapon_size = eX * panel_size.x*(1/columns) + eY * panel_size.y*(1/rows);
        }
@@ -729,7 +747,7 @@ void HUD_Weapons(void)
                // draw the weapon accuracy
                if(autocvar_hud_panel_weapons_accuracy)
                {
-                       panel_weapon_accuracy = weapon_accuracy[self.weapon-WEP_FIRST];
+                       float panel_weapon_accuracy = weapon_accuracy[self.weapon-WEP_FIRST];
                        if(panel_weapon_accuracy >= 0)
                        {
                                color = Accuracy_GetColor(panel_weapon_accuracy);
@@ -765,6 +783,7 @@ void HUD_Weapons(void)
                        // draw ammo status bar
                        if(autocvar_hud_panel_weapons_ammo && (self.ammo_field != ammo_none))
                        {
+                               float ammo_full;
                                a = getstati(GetAmmoStat(self.ammo_field)); // how much ammo do we have?
 
                                if(a > 0)
@@ -1015,15 +1034,10 @@ void HUD_Ammo(void)
        else
                nade_prevstatus = nade_prevframe = nade_statuschange_time = 0;
 
-       rows = mySize.y/mySize.x;
-       rows = bound(1, floor((sqrt(4 * (3/1) * rows * (total_ammo_count) + rows * rows) + rows + 0.5) / 2), (total_ammo_count));
-       //                               ^^^ ammo item aspect goes here
-
+       rows = HUD_GetRowCount(total_ammo_count, mySize, 3);
        columns = ceil((total_ammo_count)/rows);
-
        ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
 
-
        vector offset = '0 0 0'; // fteqcc sucks
        float newSize;
        if(ammo_size.x/ammo_size.y > 3)
@@ -2309,12 +2323,8 @@ void HUD_Score(void)
                }
                if(spectatee_status == -1)
                {
-                       rows = mySize.y/mySize.x;
-                       rows = bound(1, floor((sqrt(4 * (3/1) * rows * team_count + rows * rows) + rows + 0.5) / 2), team_count);
-                       //                               ^^^ ammo item aspect goes here
-
+                       rows = HUD_GetRowCount(team_count, mySize, 3);
                        columns = ceil(team_count/rows);
-
                        score_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
 
                        float newSize;
@@ -2742,9 +2752,8 @@ void HUD_Mod_CA(vector myPos, vector mySize)
        else //if(gametype == MAPINFO_TYPE_FREEZETAG)
                layout = autocvar_hud_panel_modicons_freezetag_layout;
        float rows, columns, aspect_ratio;
-       rows = mySize.y/mySize.x;
        aspect_ratio = (layout) ? 2 : 1;
-       rows = bound(1, floor((sqrt((4 * aspect_ratio * team_count + rows) * rows) + rows + 0.5) / 2), team_count);
+       rows = HUD_GetRowCount(team_count, mySize, aspect_ratio);
        columns = ceil(team_count/rows);
 
        int i;
@@ -3338,9 +3347,8 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
 
        int layout = autocvar_hud_panel_modicons_dom_layout;
        float rows, columns, aspect_ratio;
-       rows = mySize.y/mySize.x;
        aspect_ratio = (layout) ? 3 : 1;
-       rows = bound(1, floor((sqrt((4 * aspect_ratio * team_count + rows) * rows) + rows + 0.5) / 2), team_count);
+       rows = HUD_GetRowCount(team_count, mySize, aspect_ratio);
        columns = ceil(team_count/rows);
 
        int i;
index dec00043f9baf0300382d7867f0476a15ebf28c6..cd518e091d3c2ecdd3677aaf7c2ca50a5f6217aa 100644 (file)
@@ -1,98 +1,94 @@
 #include "tuba.qh"
 
-void tubasound(entity e, float restart)
+#define TUBA_STARTNOTE(i, n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
+
+const int TUBA_MIN = -18;
+const int TUBA_MAX = 27;
+const int TUBA_INSTRUMENTS = 3;
+
+.int note;
+.bool tuba_attenuate;
+.float tuba_volume;
+.float tuba_volume_initial;
+.int tuba_instrument;
+
+int Tuba_PitchStep;
+
+void tubasound(entity e, bool restart)
 {
-       string snd1;
-
-       snd1 = string_null;
-
-       if(Tuba_PitchStep)
-       {
-               string snd2;
-               float f1, f2;
-               float p1, p2;
-               float m;
-
-               f1 = 1;
-               p1 = 1;
-               snd2 = string_null;
-               f2 = 0;
-               p2 = 1;
-
-               m = e.note % Tuba_PitchStep;
-               if(m)
-               {
-                       if(e.note - m < TUBA_MIN)
-                       {
-                               if(restart)
+       string snd1 = string_null;
+       if (Tuba_PitchStep) {
+               float vol1 = 1;
+               float speed1 = 1;
+               string snd2 = string_null;
+               float vol2 = 0;
+               float speed2 = 1;
+
+               int m = pymod(e.note, Tuba_PitchStep);
+               if (m) {
+                       if (e.note - m < TUBA_MIN) {
+                               if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
-                               p1 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
-                       }
-                       else if(e.note - m + Tuba_PitchStep > TUBA_MAX)
-                       {
-                               if(restart)
+                               }
+                               speed1 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+                       } else if (e.note - m + Tuba_PitchStep > TUBA_MAX) {
+                               if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
-                               p1 = pow(2.0, m / 12.0);
-                       }
-                       else
-                       {
-                               if(restart)
+                               }
+                               speed1 = pow(2.0, m / 12.0);
+                       } else {
+                               if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
-                               f1 = cos(M_PI_2 * m / Tuba_PitchStep);
-                               p1 = pow(2.0, m / 12.0);
-                               if(restart)
+                               }
+                               vol1 = cos(M_PI_2 * m / Tuba_PitchStep);
+                               speed1 = pow(2.0, m / 12.0);
+                               if (restart) {
                                        snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
-                               f2 = sin(M_PI_2 * m / Tuba_PitchStep);
-                               p2 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+                               }
+                               vol2 = sin(M_PI_2 * m / Tuba_PitchStep);
+                               speed2 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
                        }
-               }
-               else
-               {
-                       if(restart)
-                               snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
+               } else if (restart) {
+                       snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
                }
 
-               sound7(e, CH_TUBA_SINGLE, snd1, e.cnt * f1, e.attenuate * autocvar_g_balance_tuba_attenuation, 100 * p1, 0);
-               if(f2)
-                       sound7(e.enemy, CH_TUBA_SINGLE, snd2, e.cnt * f2, e.attenuate * autocvar_g_balance_tuba_attenuation, 100 * p2, 0);
-       }
-       else
-       {
-               if(restart)
+               sound7(e, CH_TUBA_SINGLE, snd1, e.tuba_volume * vol1, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation, 100 * speed1, 0);
+               if (vol2) {
+                       sound7(e.enemy, CH_TUBA_SINGLE, snd2, e.tuba_volume * vol2, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation, 100 * speed2, 0);
+               }
+       } else {
+               if (restart) {
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
-               sound(e, CH_TUBA_SINGLE, snd1, e.cnt, e.attenuate * autocvar_g_balance_tuba_attenuation);
+               }
+               sound(e, CH_TUBA_SINGLE, snd1, e.tuba_volume, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation);
        }
 }
 
 void Ent_TubaNote_Think()
 {
-       float f;
-       f = autocvar_g_balance_tuba_fadetime;
-       if(f > 0)
-               self.cnt -= frametime * self.count / f;
-       else
-               self.cnt = 0;
+       float f = autocvar_g_balance_tuba_fadetime;
+       if (f > 0) {
+               self.tuba_volume -= frametime * self.tuba_volume_initial / f;
+       } else {
+               self.tuba_volume = 0;
+       }
        self.nextthink = time;
-       if(self.cnt <= 0)
-       {
+       if (self.tuba_volume <= 0) {
                sound(self, CH_TUBA_SINGLE, "misc/null.wav", 0, 0);
-               if(self.enemy)
-               {
+               if (self.enemy) {
                        sound(self.enemy, CH_TUBA_SINGLE, "misc/null.wav", 0, 0);
                        remove(self.enemy);
                }
                remove(self);
-       }
-       else
-       {
+       } else {
                tubasound(self, 0);
        }
 }
 
 void Ent_TubaNote_UpdateSound()
 {
-       self.enemy.cnt = bound(0, VOL_BASE * autocvar_g_balance_tuba_volume, 1);
-       self.enemy.count = self.enemy.cnt;
+       self.enemy.tuba_volume = bound(0, VOL_BASE * autocvar_g_balance_tuba_volume, 1);
+       self.enemy.tuba_volume_initial = self.enemy.tuba_volume;
        self.enemy.note = self.note;
        self.enemy.tuba_instrument = self.tuba_instrument;
        tubasound(self.enemy, 1);
@@ -104,57 +100,47 @@ void Ent_TubaNote_StopSound()
        self.enemy = world;
 }
 
-void Ent_TubaNote(float bIsNew)
+void Ent_TubaNote(bool isNew)
 {
-    int f, n, i;
-       float att, upd;
-       f = ReadByte();
-
-       upd = 0;
-
-       if(f & 1)
-       {
-               n = ReadChar();
-               i = ReadByte();
-               att = (i & 1);
-               i = floor(i / 2);
-
-               if(n != self.note || i != self.tuba_instrument || bIsNew)
-               {
-                       if(self.enemy)
+       bool upd = false;
+       int f = ReadByte();
+       if (f & 1) {
+               int n = ReadChar();
+               int i = ReadByte();
+               bool att = (i & 1);
+               i >>= 1;
+
+               if (self.enemy) {
+                       if (n != self.note || i != self.tuba_instrument || isNew) {
                                Ent_TubaNote_StopSound();
-               }
-
-               if(!self.enemy)
-               {
+                       }
+               } else {
                        self.enemy = spawn();
                        self.enemy.classname = "tuba_note";
-                       if(Tuba_PitchStep)
-                       {
+                       if (Tuba_PitchStep) {
                                self.enemy.enemy = spawn();
                                self.enemy.enemy.classname = "tuba_note_2";
                        }
-                       bIsNew = true;
+                       isNew = true;
                }
 
-               self.enemy.attenuate = att;
+               self.enemy.tuba_attenuate = att;
 
-               if(bIsNew)
-               {
+               if (isNew) {
                        self.note = n;
                        self.tuba_instrument = i;
-                       upd = 1;
+                       upd = true;
                }
        }
 
-       if(f & 2)
-       {
+       if (f & 2) {
                self.enemy.origin_x = ReadCoord();
                self.enemy.origin_y = ReadCoord();
                self.enemy.origin_z = ReadCoord();
                setorigin(self.enemy, self.enemy.origin);
-               if(self.enemy.enemy)
+               if (self.enemy.enemy) {
                        setorigin(self.enemy.enemy, self.enemy.origin);
+               }
        }
 
        self.think = Ent_TubaNote_StopSound;
@@ -162,29 +148,25 @@ void Ent_TubaNote(float bIsNew)
        self.enemy.think = Ent_TubaNote_Think;
        self.enemy.nextthink = time + 10;
 
-       if(upd)
+       if (upd) {
                Ent_TubaNote_UpdateSound();
+       }
 }
 
 void Tuba_Precache()
 {
-       float i;
-    int n;
        Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
-       if(Tuba_PitchStep)
-       {
-               if(!checkextension("DP_SND_SOUND7_WIP2") && !checkextension("DP_SND_SOUND7"))
-               {
+       if (Tuba_PitchStep) {
+               if (!checkextension("DP_SND_SOUND7_WIP2") && !checkextension("DP_SND_SOUND7")) {
                        print("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
                        Tuba_PitchStep = 0;
                }
        }
-       for(n = TUBA_MIN; n <= TUBA_MAX; ++n)
-       {
-               if(!Tuba_PitchStep || ((n % Tuba_PitchStep) == 0))
-               {
-                       for(i = 0; i < TUBA_INSTRUMENTS; ++i)
+       for (int n = TUBA_MIN; n <= TUBA_MAX; ++n) {
+               if (!Tuba_PitchStep || pymod(n, Tuba_PitchStep) == 0) {
+                       for (int i = 0; i < TUBA_INSTRUMENTS; ++i) {
                                precache_sound(TUBA_STARTNOTE(i, n));
+                       }
                }
        }
 }
index 81517b4e41bd7a452e0bb0360215ce17f41fdf9f..bdc1386eab666e352dd4d1ed9413a5d5fe237de3 100644 (file)
@@ -1,28 +1,5 @@
 #ifndef TUBA_H
 #define TUBA_H
-
-const float TUBA_MIN = -18;
-const float TUBA_MAX =  27;
-const float TUBA_INSTRUMENTS = 3;
-
-#define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
-.int note; // note
-.float attenuate; // if set, attenuate it
-.float cnt; // current volume
-.float count; // initial volume
-.float tuba_instrument;
-
-int Tuba_PitchStep;
-
-void tubasound(entity e, float restart);
-
-void Ent_TubaNote_Think();
-
-void Ent_TubaNote_UpdateSound();
-
-void Ent_TubaNote_StopSound();
-
-void Ent_TubaNote(float bIsNew);
-
+void Ent_TubaNote(bool isNew);
 void Tuba_Precache();
 #endif
index 366f35ed6eddde8c36e5fb5d23b009d5a5897c0f..c3f15d1937e4963b06a1f6343c0d896c6ac44ce4 100644 (file)
@@ -1287,11 +1287,11 @@ float MapInfo_CheckMap(string s) // returns 0 if the map can't be played with th
        return r;
 }
 
-void MapInfo_SwitchGameType(float t)
+void MapInfo_SwitchGameType(int t)
 {
-       entity e;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for (entity e = MapInfo_Type_first; e; e = e.enemy) {
                cvar_set(e.netname, (t == e.items) ? "1" : "0");
+       }
 }
 
 void MapInfo_LoadMap(string s, float reinit)
index 6083350fa92028cf2be820c251875847a0927e9e..54255ec8d2aa153abfb6da7242d08b3635c40423 100644 (file)
@@ -152,7 +152,7 @@ float MapInfo_Type_FromString(string t);
 string MapInfo_Type_Description(float t);
 string MapInfo_Type_ToString(float t);
 string MapInfo_Type_ToText(float t);
-void MapInfo_SwitchGameType(float t);
+void MapInfo_SwitchGameType(int t);
 
 // to be called from worldspawn to set up cvars
 void MapInfo_LoadMapSettings(string s);
index 7de776dda392be70013202a76b7607a5d64cce87..8eaff86e35241899d5a760600f858b451e1c11f6 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '1 0.5 0.5',
 /* modelname */ "laser",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshairlaser 0.4",
+/* crosshair */ "gfx/crosshairlaser 0.5",
 /* wepimg    */ "weaponlaser",
 /* refname   */ "blaster",
 /* wepname   */ _("Blaster")
index ee4878fd4b059c5d7d45d55339e950ca22d7bea7..21a86e7da0c33f7d901584c194b4575a450ca47e 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '1 0.5 1',
 /* modelname */ "crylink",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshaircrylink 0.4",
+/* crosshair */ "gfx/crosshaircrylink 0.5",
 /* wepimg    */ "weaponcrylink",
 /* refname   */ "crylink",
 /* wepname   */ _("Crylink")
index dd167aac23c7e0ec1afdb61eae174e6d35458184..9e5f98a492033c49f1121aa6f72ce30e0793a8b5 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '1 1 0',
 /* modelname */ "rl",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshairrocketlauncher 0.5875",
+/* crosshair */ "gfx/crosshairrocketlauncher 0.7",
 /* wepimg    */ "weaponrocketlauncher",
 /* refname   */ "devastator",
 /* wepname   */ _("Devastator")
index eadfa0b3b45f322e26132b2506bbea29715b7192..3f5e75159b5b8339490f0eb2c8aff57664e2fa65 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '0 0.5 1',
 /* modelname */ "electro",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshairelectro 0.5",
+/* crosshair */ "gfx/crosshairelectro 0.6",
 /* wepimg    */ "weaponelectro",
 /* refname   */ "electro",
 /* wepname   */ _("Electro")
index ccc87fdc72601598be2990578afc25e4ca6b0423..f20872f7045067fb300a1c24ffd6240a0af5e773 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '0.5 1 0',
 /* modelname */ "campingrifle",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshairrifle 0.5",
+/* crosshair */ "gfx/crosshairrifle 0.6",
 /* wepimg    */ "weaponrifle",
 /* refname   */ "rifle",
 /* wepname   */ _("Rifle")
index b073a31704e8ab51dc93788cc5b94578d01ac4b9..387dc32d82eb5c891bc40b3a8fbbdd6e6a70a50e 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '0.5 0.5 0',
 /* modelname */ "ok_rl",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshairrocketlauncher 0.5875",
+/* crosshair */ "gfx/crosshairrocketlauncher 0.7",
 /* wepimg    */ "weaponrpc",
 /* refname   */ "rpc",
 /* wepname      */ _("Rocket Propelled Chainsaw")
index 0e78dbae93f98336bc5131ad90f9ea219c12f784..14377edb8651489cc9901c1d26d7c3c54658d74a 100644 (file)
@@ -9,7 +9,7 @@ REGISTER_WEAPON(
 /* color     */ '0.5 1 1',
 /* modelname */ "minstanex",
 /* simplemdl */ "foobar",
-/* crosshair */ "gfx/crosshairminstanex 0.4",
+/* crosshair */ "gfx/crosshairminstanex 0.6",
 /* wepimg    */ "weaponminstanex",
 /* refname   */ "vaporizer",
 /* wepname   */ _("Vaporizer")
index 6f820c729f11af7ae494db7968b7bf7bc76b6f52..4effe6492446b65192b91d838bebd11da4828c1b 100644 (file)
@@ -1420,6 +1420,12 @@ void(float fh, entity e) writetofile = #606;
 float(string s) isfunction = #607;
 void(entity e, string s) parseentitydata = #608;
 
+//DP_COVERAGE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//function definitions:
+void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
+
 // assorted builtins
 //const int STAT_MOVEVARS_TICRATE              = 240;
 //const int STAT_MOVEVARS_TIMESCALE            = 241;
index 26d351a209b80518c6295cc41b2d3d33ddee60ad..109e9195bb03cda7212ef627a29fbe8cd5785e4c 100644 (file)
@@ -437,7 +437,7 @@ void(entity e, entity tagentity, string tagname) setattachment = #443; // attach
 //darkplaces implementation: Blub\0
 //cvar definitions:
 //   utf8_enable: enable utf8 encoding
-//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
+//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., 
 //and count as 1 char for string functions like strlen, substring, etc.
 // note: utf8_enable is run-time cvar, could be changed during execution
 // note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
@@ -499,7 +499,7 @@ void(entity e, entity tagentity, string tagname) setattachment = #443; // attach
 // description: allows alternative 'static' lightstyle syntax : "=value"
 // examples: "=0.5", "=2.0", "=2.75"
 // could be used to control switchable lights or making styled lights with brightness > 2
-// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
+// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact 
 // that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
 
 //DP_LITSPRITES
@@ -1359,14 +1359,14 @@ float(string sample) soundlength = #534; // returns length of sound sample in se
 //syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
 //   <start> <end> "string"
 //   start: subtitle start time in seconds
-//     end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
+//     end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, 
 //          if below 0 - show until next subtitles minus this number of seconds
 //    text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
 //example of subtitle file:
 //   3 0       "Vengeance! Vengeance for my eternity of suffering!"
 //   9 0       "Whelp! As if you knew what eternity was!"
 //   13        0       "Grovel before your true master."
-//   17        0       "Never!"
+//   17        0       "Never!" 
 //   18        7       "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
 
 //DP_SOLIDCORPSE
@@ -1733,11 +1733,11 @@ const float FORCETYPE_TORQUE = 3;
 .vector massofs;      // offsets a mass center out of object center, if not set a center of model bounds is used
 .float  friction;     // a friction of object, get multiplied by second objects's friction on contact
 .float  bouncefactor;
-.float  bouncestop;
+.float  bouncestop; 
 .float  jointtype;    // type of joint
 .float  forcetype;    // type of force
-.float  erp;          // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
-                      // bringing together 2 joints or fixing object being stuch in other object,
+.float  erp;          // error restitution parameter, makes ODE solver attempt to fix errors in contacts, 
+                      // bringing together 2 joints or fixing object being stuch in other object, 
                                  // a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
                                  // use with care as high values makes system unstable and likely to explode
 //builtin definitions:
@@ -2536,7 +2536,11 @@ void(float pause) setpause = #531;
 //
 //Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause.  In other words, the only things that are not called are think and other time-related functions.
 
-
+//DP_COVERAGE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//function definitions:
+void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
 
 
 // EXPERIMENTAL (not finalized) EXTENSIONS:
@@ -2545,9 +2549,10 @@ void(float pause) setpause = #531;
 //idea: divVerent
 //darkplaces implementation: divVerent
 //field definitions: (SVQC)
-.string crypto_keyfp; // fingerprint of CA key the player used to authenticate, or string_null if not verified
-.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player, or string_null if not verified
+.string crypto_keyfp; // fingerprint of CA key the player used to authenticate
+.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player
 .string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified
+.float crypto_idfp_signed; // set if the player's ID has been signed
 .string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext
 .string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext
 // there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for
index 83cb073a3e872e161e1ce4b3badd92e9a7fffe47..853fa25f21cbd2be4bdb80f9fe3af24618911b79 100644 (file)
@@ -297,7 +297,7 @@ float       drawstring(vector position, string text, vector scale, vector rgb, float a
 float  drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
 
 vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
-
 float  drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
 
 float  drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
@@ -347,6 +347,7 @@ float(string key) stringtokeynum = #341;
 //field definitions: (MENUQC)
 string(string serveraddress) crypto_getkeyfp = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
 string(string serveraddress) crypto_getidfp = #634; // retrieves the cached host key fingerprint of a server given by IP address
+float(string serveraddress) crypto_getidstatus = #643; // retrieves the cached host key's key status. See below for CRYPTO_IDSTATUS_ defines.
 string(string serveraddress) crypto_getencryptlevel = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
 string(float i) crypto_getmykeyfp = #636; // retrieves the CA key fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
 string(float i) crypto_getmyidfp = #637; // retrieves the ID fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
@@ -524,6 +525,12 @@ float FIELD_FUNCTION = 6;
 //getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
 //putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
 
+//DP_COVERAGE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//function definitions:
+void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
+
 // assorted undocumented extensions
 string(string, float) netaddress_resolve = #625;
 string(string search, string replace, string subject) strreplace = #484;
index bff21707906c9919927ce8557a5934aacbaa4bff..3ef656744568ad3b0ebfd25768e5acf3267fbfe5 100644 (file)
@@ -150,22 +150,11 @@ void ModalController_draw(entity me)
                if(e.ModalController_state)
                {
                        if(front)
-                       {
                                me.switchState(me, front, 2, 0);
-                               if(front.ModalController_factor < 1)
-                                       animating = 1;
-                       }
                        front = e;
                }
        if(front)
-       {
                me.switchState(me, front, 1, 0);
-               if(front.ModalController_factor < 1)
-                       animating = 1;
-       }
-
-       if(front && front.Container_alpha == front.ModalController_initialAlpha)
-               goto update_done; // update isn't needed, everything stay as is
 
        df = frametime * 3; // animation speed
 
@@ -209,6 +198,7 @@ void ModalController_draw(entity me)
                                me.setAlphaOf(me, e, e.Container_alpha  * prevFactor);
                        else
                        {
+                               animating = 1;
                                targetFactor = df / (1 - f + df);
 
                                if(e.ModalController_state == 1)
@@ -234,7 +224,6 @@ void ModalController_draw(entity me)
                        e.Container_fontscale_y = fs.y * e.ModalController_initialFontScale.y;
                }
        }
-       :update_done
 
        if(animating || !me.focused)
                me.setFocus(me, NULL);
index 90988703e0e5f9fa491ef0759e2a95a358b7fec3..9c38e0e04f4eed5bafe417a2fd31e2fd5286ec5b 100644 (file)
@@ -84,9 +84,9 @@ void XonoticFirstRunDialog_fill(entity me)
 
        me.gotoRC(me, me.rows - 3, 0);
        me.TDempty(me, 1.5);
-       me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", ZCTX(_("ALWU2N^Yes"))));
-       me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", ZCTX(_("ALWU2N^No"))));
-       me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", ZCTX(_("ALWU2N^Undecided"))));
+       me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", _("Yes")));
+       me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", _("No")));
+       me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", _("Undecided")));
 
        // because of the language selector, this is a menu_restart!
        me.gotoRC(me, me.rows - 1, 0);
index 04c67e727b088b30a15cfbcc09f8d562ad3621e4..4e76cbc6d3a5095560d41dd71da3bbb969476678 100644 (file)
@@ -187,6 +187,7 @@ void XonoticServerCreateTab_gameTypeChangeNotify(entity me)
                case MAPINFO_TYPE_ONSLAUGHT:  GameType_ConfigureSliders(e, l, _("Point limit:"),    50,  500, 10, "");                         break;
                case MAPINFO_TYPE_CTS:        GameType_ConfigureSliders(e, l, _("Point limit:"),    50,  500, 10, "");                         break;
                case MAPINFO_TYPE_INVASION:   GameType_ConfigureSliders(e, l, _("Point limit:"),     5,    0,  5, "");                         break;
+       case MAPINFO_TYPE_TEAM_DEATHMATCH:GameType_ConfigureSliders(e, l, _("Point limit:"),     5,  100,  5, "g_tdm_point_limit");        break;
                default:                      GameType_ConfigureSliders(e, l, _("Frag limit:"),      5,  100,  5, "fraglimit_override");       break;
        }
 
index a5a97c5503fe77f30a1064b657c2bdcd0fb67eee..136997eec0afae2a1b2451d1b5eb5d8e6af68e6f 100644 (file)
@@ -21,10 +21,10 @@ void XonoticDemoStartConfirmDialog_fill(entity me)
                me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you really wish to disconnect now?")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^Yes")), '1 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0'));
                        e.onClick = Handle_StartDemo_Click;
                        e.onClickEntity = demolist;
-               me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^No")), '0 1 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 5510710c2c21a4b22e0c874dcd3dbd489021e7de..5c9bf8cb3d12ba9d6b633d1f1cd8cf27448728f8 100644 (file)
@@ -21,10 +21,10 @@ void XonoticDemoTimeConfirmDialog_fill(entity me)
                me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you really wish to disconnect now?")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^Yes")), '1 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0'));
                        e.onClick = Handle_TimeDemo_Click;
                        e.onClickEntity = demolist;
-               me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^No")), '0 1 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 1adfb015eff1d85e192034eab19ce93c93f351cb..06bf7924444ffc6651b595f2e3536bb7c7b6f931 100644 (file)
@@ -142,9 +142,9 @@ void XonoticProfileTab_fill(entity me)
        #if 0
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gender:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("_cl_gender"));
-                       e.addValue(e, ZCTX(_("GENDER^Undisclosed")), "0");
-                       e.addValue(e, ZCTX(_("GENDER^Female")), "1");
-                       e.addValue(e, ZCTX(_("GENDER^Male")), "2");
+                       e.addValue(e, _("Undisclosed"), "0");
+                       e.addValue(e, _("Female"), "1");
+                       e.addValue(e, _("Male"), "2");
                        e.configureXonoticTextSliderValues(e);
        #else
                        me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gender")));
index 811cb0998f2774588359af13bee781431b1619f7..fcbbbbe0e19b6a740576762a673d725b16e21bd4 100644 (file)
@@ -148,9 +148,9 @@ void XonoticEffectsSettingsTab_fill(entity me)
                me.TDempty(me, 0.2);
                me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Damage effects:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
-                       e.addValue(e, _("Disabled"), "0");
+                       e.addValue(e, ZCTX(_("DMGFX^Disabled")), "0");
                        e.addValue(e, _("Skeletal"), "1");
-                       e.addValue(e, _("All"), "2");
+                       e.addValue(e, ZCTX(_("DMGFX^All")), "2");
                        e.configureXonoticTextSliderValues(e);
 
        me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn);
index 0aa38e85af2d472be53c18f53c6d32003c946c86..28cf3708f3af0833b98028ef9b42e433a934292c 100644 (file)
@@ -40,8 +40,8 @@ void XonoticGameCrosshairSettingsTab_fill(entity me)
                me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom")));
        me.TR(me);
                me.TDempty(me, 0.1);
-               for(i = 1; i <= 14; ++i) {
-                       me.TDNoMargin(me, 1, 2 / 14, e = makeXonoticCrosshairButton(4, i), '1 1 0');
+               for(i = 31; i <= 42; ++i) {
+                       me.TDNoMargin(me, 1, 2 / 12, e = makeXonoticCrosshairButton(4, i), '1 1 0');
                                setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
                }
                // show a larger preview of the selected crosshair
@@ -50,14 +50,14 @@ void XonoticGameCrosshairSettingsTab_fill(entity me)
                        setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
        me.TR(me);
                me.TDempty(me, 0.1);
-               for(i = 15; i <= 28; ++i) {
-                       me.TDNoMargin(me, 1, 2 / 14, e = makeXonoticCrosshairButton(4, i), '1 1 0');
+               for(i = 43; i <= 54; ++i) {
+                       me.TDNoMargin(me, 1, 2 / 12, e = makeXonoticCrosshairButton(4, i), '1 1 0');
                                setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
                }
        me.TR(me);
                me.TDempty(me, 0.1);
-               for(i = 29; i <= 42; ++i) {
-                       me.TDNoMargin(me, 1, 2 / 14, e = makeXonoticCrosshairButton(4, i), '1 1 0');
+               for(i = 55; i <= 66; ++i) {
+                       me.TDNoMargin(me, 1, 2 / 12, e = makeXonoticCrosshairButton(4, i), '1 1 0');
                                setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
                }
        me.TR(me);
index fc7e3a136abb12250ac5af16ca22e38d4b7187f9..bb0587184be7b6ca1491c4cc2730a3eb9831091a 100644 (file)
@@ -142,9 +142,9 @@ void XonoticGameHUDSettingsTab_fill(entity me)
                me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Decolorize:")));
                        setDependent(e, "hud_shownames", 1, 1);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_shownames_decolorize"));
-                       e.addValue(e, ZCTX(_("Never")), "0");
-                       e.addValue(e, ZCTX(_("Teamplay")), "1");
-                       e.addValue(e, ZCTX(_("Always")), "2");
+                       e.addValue(e, _("Never"), "0");
+                       e.addValue(e, _("Teamplay"), "1");
+                       e.addValue(e, _("Always"), "2");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "hud_shownames", 1, 1);
 
index 7749a148d96a5a6e77d5bb2c57123c19b106d528..9f327c3f51245c96cf4df83480c6eaceb88c92e5 100644 (file)
@@ -30,10 +30,10 @@ void XonoticHUDConfirmDialog_fill(entity me)
                me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you wish to start a local game to set up the HUD?")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("HDCNFRM^Yes")), '1 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0'));
                        e.onClick = HUDSetup_Start;
                        e.onClickEntity = me;
-               me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("HDCNFRM^No")), '0 1 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index f1707bd3f57fd414540c7ec9e026106107062a38..034608d096d396ca59142133ff54018ef5c9b62f 100644 (file)
@@ -52,10 +52,10 @@ void XonoticGameMessageSettingsTab_fill(entity me)
                me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Sprees in info messages:")));
                        setDependent(e, "notification_show_sprees", 1, 1);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("notification_show_sprees_info"));
-                       e.addValue(e, ZCTX(_("Disabled")), "0");
-                       e.addValue(e, ZCTX(_("Target")), "1");
-                       e.addValue(e, ZCTX(_("Attacker")), "2");
-                       e.addValue(e, ZCTX(_("Both")), "3");
+                       e.addValue(e, ZCTX(_("SPREES^Disabled")), "0");
+                       e.addValue(e, _("Target"), "1");
+                       e.addValue(e, _("Attacker"), "2");
+                       e.addValue(e, ZCTX(_("SPREES^Both")), "3");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "notification_show_sprees", 1, 1);
        #endif
index 0c454d3bc525de0cba701a058e704cd05850bf4c..b4ac6134834ba254d571ed93db991eede16e8bfd 100644 (file)
@@ -91,9 +91,9 @@ void XonoticInputSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Jetpack on jump:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_jetpack_jump"));
-                       e.addValue(e, _("Disabled"), "0");
+                       e.addValue(e, ZCTX(_("JPJUMP^Disabled")), "0");
                        e.addValue(e, _("Air only"), "1");
-                       e.addValue(e, _("All"), "2");
+                       e.addValue(e, ZCTX(_("JPJUMP^All")), "2");
                        e.configureXonoticTextSliderValues(e);
                        e.sendCvars = true;
        me.TR(me);
index feb1d89b133d2b4e040db7bd42d2828c500fc89f..0d36c836340f7b463d2c0af41c9197990ec67619 100644 (file)
@@ -31,12 +31,11 @@ entity makeXonoticGametypeList(void)
 }
 void XonoticGametypeList_configureXonoticGametypeList(entity me)
 {
-       float i;
        me.configureXonoticListBox(me);
        me.nItems = GameType_GetCount();
 
        // we want the pics mipmapped
-       for(i = 0; i < GameType_GetCount(); ++i)
+       for(int i = 0; i < GameType_GetCount(); ++i)
                draw_PreloadPictureWithFlags(GameType_GetIcon(i), PRECACHE_PIC_MIPMAP);
 
        me.loadCvars(me);
@@ -67,12 +66,15 @@ void XonoticGametypeList_loadCvars(entity me)
 }
 void XonoticGametypeList_saveCvars(entity me)
 {
-       float t;
-       t = GameType_GetID(me.selectedItem);
-       if(t == MapInfo_CurrentGametype())
+       int t = GameType_GetID(me.selectedItem);
+       if (t == MapInfo_CurrentGametype()) {
                return;
+       }
        MapInfo_SwitchGameType(t);
-       me.parent.gameTypeChangeNotify(me.parent);
+       entity owner = me.parent;
+       if (owner) { // not set immediately
+               owner.gameTypeChangeNotify(owner);
+       }
 }
 void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
 {
index 0846526d0c66283fd46e94f0624414c0cec6d103..330b2bb726a0e89ccc19822ee8c8af0182b82e0e 100644 (file)
@@ -665,12 +665,11 @@ float updateCompression()
        //GAMETYPE(MAPINFO_TYPE_INVASION) \
        /* nothing */
 
-float GameType_GetID(float cnt)
+int GameType_GetID(int cnt)
 {
-       float i;
-       i = 0;
+       int i = 0;
 
-       #define GAMETYPE(id) { if(i++ == cnt) return id; }
+       #define GAMETYPE(id) { if (i++ == cnt) return id; }
        GAMETYPES
        #undef GAMETYPE
 
@@ -679,10 +678,9 @@ float GameType_GetID(float cnt)
        return 0;
 }
 
-float GameType_GetCount()
+int GameType_GetCount()
 {
-       float i;
-       i = 0;
+       int i = 0;
 
        #define GAMETYPE(id) ++i;
        GAMETYPES
@@ -691,9 +689,9 @@ float GameType_GetCount()
        return i;
 }
 
-string GameType_GetName(float cnt)
+string GameType_GetName(int cnt)
 {
-       float i = GameType_GetID(cnt);
+       int i = GameType_GetID(cnt);
 
        if(i)
                return MapInfo_Type_ToText(i);
@@ -701,9 +699,9 @@ string GameType_GetName(float cnt)
        return "";
 }
 
-string GameType_GetIcon(float cnt)
+string GameType_GetIcon(int cnt)
 {
-       float i = GameType_GetID(cnt);
+       int i = GameType_GetID(cnt);
 
        if(i)
                return strcat("gametype_", MapInfo_Type_ToString(i));
index 64072977f60b7baa7b7de06b7b39f848e62756a1..80803f8544df735f4363112b466441da3ad34f35 100644 (file)
@@ -34,11 +34,11 @@ void URI_Get_Callback(float id, float status, string data);
 
 // game type list box stuff (does not NEED to contain all game types, other
 // types stay available via console)
-float GameType_GetID(float cnt);
-string GameType_GetName(float cnt);
-string GameType_GetIcon(float cnt);
+int GameType_GetID(int cnt);
+string GameType_GetName(int cnt);
+string GameType_GetIcon(int cnt);
 //string GameType_GetTeams(float cnt);
-float GameType_GetCount();
+int GameType_GetCount();
 
 void dialog_hudpanel_common_notoggle(entity me, string panelname);
 #define DIALOG_HUDPANEL_COMMON_NOTOGGLE() \
index 89647d5be241eae4bb2d68944adea631942a16fc..3bc5cc762f231b2e92f8df7dfdfe4b05e9d55bb1 100644 (file)
@@ -1000,7 +1000,7 @@ float PlayerInIDList(entity p, string idlist)
        float n, i;
        string s;
 
-       // NOTE: we do NOT check crypto_keyfp here, an unsigned ID is fine too for this
+       // NOTE: we do NOT check crypto_idfp_signed here, an unsigned ID is fine too for this
        if (!p.crypto_idfp)
                return 0;
 
@@ -1249,6 +1249,13 @@ void ClientConnect (void)
        if(IS_REAL_CLIENT(self))
                sv_notice_join();
 
+       for (entity e = world; (e = findfloat(e, init_for_player_needed, 1)); ) {
+               entity oldself = self;
+               self = e;
+               e.init_for_player(oldself);
+               self = oldself;
+       }
+
        MUTATOR_CALLHOOK(ClientConnect);
 }
 /*
index 09314c745631dc119f5b32341c294c1bb488f148..5b7e761b7879077a18d841119ca0e0e2e4092c93 100644 (file)
@@ -48,13 +48,13 @@ float VerifyClientEntity(entity client, float must_be_real, float must_be_bots)
 }
 
 // if the client is not acceptable, return a string to be used for error messages
-string GetClientErrorString(float clienterror, string original_input)
+string GetClientErrorString_color(float clienterror, string original_input, string col)
 {
        switch(clienterror)
        {
-               case CLIENT_DOESNT_EXIST: { return strcat("Client '", original_input, "' doesn't exist"); }
-               case CLIENT_NOT_REAL: { return strcat("Client '", original_input, "' is not real"); }
-               case CLIENT_NOT_BOT: { return strcat("Client '", original_input, "' is not a bot"); }
+               case CLIENT_DOESNT_EXIST: { return strcat(col, "Client '", original_input, col, "' doesn't exist"); }
+               case CLIENT_NOT_REAL: { return strcat(col, "Client '", original_input, col, "' is not real"); }
+               case CLIENT_NOT_BOT: { return strcat(col, "Client '", original_input, col, "' is not a bot"); }
                default: { return "Incorrect usage of GetClientErrorString"; }
        }
 }
index 2a03041d90a56d373b98b36943cc28c9448f1d3e..ac99e32dc46d2583a677e3d687d6a067dde510ee 100644 (file)
@@ -58,7 +58,8 @@ float VerifyKickableEntity(entity client);
 float VerifyClientEntity(entity client, float must_be_real, float must_be_bots);
 
 // if the client is not acceptable, return a string to be used for error messages
-string GetClientErrorString(float clienterror, string original_input);
+string GetClientErrorString_color(float clienterror, string original_input, string col);
+#define GetClientErrorString(clienterror,original_input) GetClientErrorString_color(clienterror,original_input,"^7")
 
 // is this entity number even in the possible range of entities?
 float VerifyClientNumber(float tmp_number);
index 6edccafb156f8a48a40a325ff67438b533c88282..61fd2f3a2d44d423b8a2a1792aec5f635a7ae420 100644 (file)
@@ -235,7 +235,7 @@ void VoteCount(float first_count)
                switch(tmp_player.vote_selection)
                {
                        case VOTE_SELECT_REJECT: { ++vote_reject_count; { if(IS_PLAYER(tmp_player)) ++vote_real_reject_count; } break; }
-                       case VOTE_SELECT_ACCEPT: { ++vote_accept_count; { if(IS_PLAYER(tmp_player)) ++vote_real_reject_count; } break; }
+                       case VOTE_SELECT_ACCEPT: { ++vote_accept_count; { if(IS_PLAYER(tmp_player)) ++vote_real_accept_count; } break; }
                        case VOTE_SELECT_ABSTAIN: { ++vote_abstain_count; { if(IS_PLAYER(tmp_player)) ++vote_real_abstain_count; } break; }
                        default: break;
                }
index 175179b50797d5a5ede5cffd8352f19eb602cfc3..822c5163c384c1476656d825ab0a009f549ac406 100644 (file)
@@ -623,4 +623,8 @@ const int MIF_GUIDED_TAG = 128;
 .string playernick;
 .float elos;
 .float ranks;
+
+.float init_for_player_needed;
+.void(entity) init_for_player;
+
 #endif
index c0e54d11671093d0201ed5d51cd389d4d4859406..be6104f1fa6d2c653cc6acb25bc3f818cab46840 100644 (file)
@@ -91,7 +91,7 @@ void func_breakable_look_destroyed()
                self.dropped_origin = self.origin;
 
        if(self.mdl_dead == "")
-               self.model = "";
+               self.effects |= EF_NODRAW;
        else {
                if (self.origin == '0 0 0')     {       // probably no origin brush, so don't spawn in the middle of the map..
                        floorZ = self.absmin.z;
@@ -99,16 +99,24 @@ void func_breakable_look_destroyed()
                        self.origin_z = floorZ;
                }
                setmodel(self, self.mdl_dead);
+               self.effects &= ~EF_NODRAW;
        }
 
+       CSQCMODEL_AUTOUPDATE();
+
        self.solid = SOLID_NOT;
 }
 
 void func_breakable_look_restore()
 {
        setmodel(self, self.mdl);
+       self.effects &= ~EF_NODRAW;
+
        if(self.mdl_dead != "") // only do this if we use mdl_dead, to behave better with misc_follow
                setorigin(self, self.dropped_origin);
+
+       CSQCMODEL_AUTOUPDATE();
+
        self.solid = SOLID_BSP;
 }
 
@@ -120,6 +128,8 @@ void func_breakable_behave_destroyed()
        self.event_damage = func_null;
        self.state = 1;
        func_breakable_colormod();
+       if (self.noise1)
+               stopsound (self, CH_TRIGGER_SINGLE);
 }
 
 void func_breakable_behave_restore()
@@ -136,6 +146,17 @@ void func_breakable_behave_restore()
        self.state = 0;
        self.nextthink = 0; // cancel auto respawn
        func_breakable_colormod();
+       if (self.noise1)
+               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
+}
+
+void func_breakable_init_for_player(entity player)
+{
+       if (self.noise1 && self.state == 0 && clienttype(player) == CLIENTTYPE_REAL)
+       {
+               msg_entity = player;
+               soundto (MSG_ONE, self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
+       }
 }
 
 void func_breakable_destroyed()
@@ -270,6 +291,8 @@ void spawnfunc_func_breakable() {
                precache_model(argv(i));
        if(self.noise)
                precache_sound(self.noise);
+       if(self.noise1)
+               precache_sound(self.noise1);
 
        self.team_saved = self.team;
        self.dropped_origin = self.origin;
@@ -277,6 +300,9 @@ void spawnfunc_func_breakable() {
        self.reset = func_breakable_reset;
        func_breakable_reset();
 
+       self.init_for_player_needed = 1;
+       self.init_for_player = func_breakable_init_for_player;
+
        CSQCMODEL_AUTOINIT();
 }
 
index bd9880839d69f33ab220fd54a40eed7f87281460..9591ee8baa9d9b7620d5b5fbe32f430a8e0a22cb 100644 (file)
@@ -361,7 +361,7 @@ float Ban_GetClientIP(entity client)
        float i1, i2, i3, i4;
        string s;
 
-       if(client.crypto_keyfp)
+       if(client.crypto_idfp_signed)
                ban_idfp = client.crypto_idfp;
        else
                ban_idfp = string_null;
index 28145a2934669877af6e0b0ac054afcb952bd457..b4b9b1830509f846efa7aa64f3d701600a07974b 100644 (file)
@@ -229,6 +229,9 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
 
                        self = oldself;
                        activator = oldactivator;
+
+                       // We called an external function, so we have to re-tokenize msg.
+                       n = tokenize_console(msg);
                }
                else
                {
index b948b203eeb36ac4a06d00b6a91ab038b6dc1be3..d86af8a00ec786760c15a9440b525a7160d4a0ab 100644 (file)
@@ -175,6 +175,20 @@ float tgamma(float x)
        return exp(v.x) * v.y;
 }
 
+/**
+ * Pythonic mod:
+ * TODO: %% operator?
+ *
+ *  1 %  2 ==  1
+ * -1 %  2 ==  1
+ *  1 % -2 == -1
+ * -1 % -2 == -1
+ */
+float pymod(float x, float y)
+{
+       return x - y * floor(x / y);
+}
+
 float nearbyint(float x)
 {
        return rint(x);
index 7eebd032c43d75c4d85f736518265115c34ef276..a37ba63de6c63b87ed3dad63d12ea1ad4637fe52 100644 (file)
@@ -60,6 +60,17 @@ float erfc(float x);
 vector lgamma(float x); // value in _x, sign in _y
 float tgamma(float x);
 
+/**
+ * Pythonic mod:
+ * TODO: %% operator?
+ *
+ *  1 %  2 ==  1
+ * -1 %  2 ==  1
+ *  1 % -2 == -1
+ * -1 % -2 == -1
+ */
+float pymod(float x, float y);
+
 //float ceil(float x);
 //float floor(float x);
 float nearbyint(float x);
index df09de330756e3c2a3f98966e95e54bd7989c6e2..503c23979284e6f796268c6dfbed02b885eec214 100644 (file)
@@ -4,6 +4,7 @@ Ant "Antibody" Zucaro
 Marvin "Mirio" Beck
 Merlijn Hofstra
 Peter "Morphed" Pielak
+Ruszkai "CuBe0wL" Ákos
 Samual "Ares" Lenks
 Tyler "-z-" Mulligan
 Zac "Mario" Jardine
@@ -19,6 +20,7 @@ Jan "zykure" Behrens
 JH0nny
 Łukasz "kuniu the frogg" Polek
 Matthias "matthiaskrgr" Krüger
+Mattia "Melanosuchus" Basaglia
 MrBougo
 Nick "bitbomb" Lucca
 nilyt/nyov
@@ -69,7 +71,7 @@ MintOX
 packer
 Pearce "theShadow" Michal
 Rasmus "FruitieX" Eskola
-Ruszkai "C.Brutail" Ákos
+Ruszkai "CuBe0wL" Ákos
 Severin "sev" Meyer
 
 *Music / Sound FX
@@ -96,7 +98,7 @@ Zac "Mario" Jardine
 
 *Marketing / PR
 Tyler "-z-" Mulligan
-Ruszkai "C.Brutail" Ákos
+Ruszkai "CuBe0wL" Ákos
 Samual "Ares" Lenks
 Saulo "mand1nga" Gil
 
@@ -123,7 +125,6 @@ Dale "graphitemaster" Weiler
 **Other Active Contributors
 Erik "Ablu" Schilling
 Jope "Sless" Withers
-Mattia "Melanosuchus" Basaglia
 Mircea "Taoki" Kitsune
 Robert "ai" Kuroto
 
@@ -143,19 +144,15 @@ set_killer
 
 *Czech
 shogun assassin/woky
+Tomáš "CZHeron" Volavka
 
 *Dutch
 Alexander "freefang" van Dam
 PinkRobot
 vegiburger
 
-*German
-cvcxc
-Erik "Ablu" Schilling
-Jope "Sless" Withers
-Marvin "Mirio" Beck
-Rudolf "divVerent" Polzer
-Yepoleb
+*English (Australia)
+Zac "Mario" Jardine
 
 *Finnish
 Henry "Exitium" Sanmark
@@ -167,6 +164,14 @@ Maxime "Taximus" Paradis
 RedGuff
 Yannick "SpiKe" Le Guen
 
+*German
+cvcxc
+Erik "Ablu" Schilling
+Jope "Sless" Withers
+Marvin "Mirio" Beck
+Rudolf "divVerent" Polzer
+Yepoleb
+
 *Greek
 Γιάννης "Evropi" Α.
 Konstantinos "LDinos" Mihalenas
@@ -174,7 +179,7 @@ Savoritias
 Vindex
 
 *Hungarian
-Ruszkai "C.Brutail" Ákos
+Ruszkai "CuBe0wL" Ákos
 xaN1C4n3
 
 *Japanese
@@ -188,6 +193,7 @@ XCostaX
 
 *Polish
 4m
+Alex "tiprogrammierer.alex" Progger
 Amadeusz "amade/proraide" Sławiński
 
 *Portuguese
@@ -197,9 +203,11 @@ xXxCHAOTICxXx
 *Romanian
 BusterDBK
 Mircea "Taoki" Kitsune
+Tudor "TropiKo" Ionel
 
 *Russian
 Alex "alextalker7" Talker
+Alexandr "zrg"
 Andrei "adem4ik" Stepanov
 gravicappa
 Hot Dog
@@ -218,7 +226,7 @@ Alan "aagp" Garcia
 Ari_tent
 brunodeleo
 Kammy
-roader_gentto
+roader_gentoo
 Rodrigo Mouton Laudin
 SouL