From: Martin Taibr Date: Fri, 7 Oct 2016 20:04:28 +0000 (+0200) Subject: Merge branch 'master' into martin-t/msnt X-Git-Tag: xonotic-v0.8.2~456^2~13 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=7c8f38e643c87bf9c02c2265ca43714c57ebe331;hp=7c19f3ad74b2adb7d2490d3d6b33fc9f1eda007f Merge branch 'master' into martin-t/msnt --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 1470c3326b..f0aeead931 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -397,10 +397,11 @@ set g_balance_devastator_reload_ammo 0 set g_balance_devastator_reload_time 2 set g_balance_devastator_remote_damage 70 set g_balance_devastator_remote_edgedamage 35 -set g_balance_devastator_remote_force 450 +set g_balance_devastator_remote_force 300 set g_balance_devastator_remote_jump_damage 70 -set g_balance_devastator_remote_jump_radius 0 -set g_balance_devastator_remote_jump_velocity_z_add 400 +set g_balance_devastator_remote_jump_force 450 +set g_balance_devastator_remote_jump_radius 100 +set g_balance_devastator_remote_jump_velocity_z_add 0 set g_balance_devastator_remote_jump_velocity_z_max 1500 set g_balance_devastator_remote_jump_velocity_z_min 400 set g_balance_devastator_remote_radius 110 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index d4b47594d7..41c9081b92 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -399,6 +399,7 @@ set g_balance_devastator_remote_damage 105 set g_balance_devastator_remote_edgedamage 40 set g_balance_devastator_remote_force 600 set g_balance_devastator_remote_jump_damage 70 +set g_balance_devastator_remote_jump_force 0 set g_balance_devastator_remote_jump_radius 0 set g_balance_devastator_remote_jump_velocity_z_add 400 set g_balance_devastator_remote_jump_velocity_z_max 1500 diff --git a/bal-wep-overkill.cfg b/bal-wep-overkill.cfg index d7463338aa..82609a76ca 100644 --- a/bal-wep-overkill.cfg +++ b/bal-wep-overkill.cfg @@ -84,7 +84,7 @@ set g_balance_machinegun_reload_time 1.5 set g_balance_machinegun_solidpenetration 13.1 set g_balance_machinegun_spread_add 0.012 set g_balance_machinegun_spread_max 0.05 -set g_balance_machinegun_spread_min 0.02 +set g_balance_machinegun_spread_min 0 set g_balance_machinegun_sustained_ammo 1 set g_balance_machinegun_sustained_damage 25 set g_balance_machinegun_sustained_force 5 @@ -302,7 +302,7 @@ set g_balance_vortex_charge_shot_multiplier 0 set g_balance_vortex_charge_start 0.5 set g_balance_vortex_charge_velocity_rate 0 set g_balance_vortex_primary_ammo 10 -set g_balance_vortex_primary_animtime 0.95 +set g_balance_vortex_primary_animtime 0.65 set g_balance_vortex_primary_damage 100 set g_balance_vortex_primary_damagefalloff_forcehalflife 0 set g_balance_vortex_primary_damagefalloff_halflife 0 @@ -325,8 +325,8 @@ set g_balance_vortex_secondary_damagefalloff_maxdist 0 set g_balance_vortex_secondary_damagefalloff_mindist 0 set g_balance_vortex_secondary_force 0 set g_balance_vortex_secondary_refire 0 -set g_balance_vortex_switchdelay_drop 0.25 -set g_balance_vortex_switchdelay_raise 0.25 +set g_balance_vortex_switchdelay_drop 0.2 +set g_balance_vortex_switchdelay_raise 0.2 set g_balance_vortex_weaponreplace "" set g_balance_vortex_weaponstart 0 set g_balance_vortex_weaponstartoverride -1 @@ -399,6 +399,7 @@ set g_balance_devastator_remote_damage 70 set g_balance_devastator_remote_edgedamage 35 set g_balance_devastator_remote_force 300 set g_balance_devastator_remote_jump_damage 70 +set g_balance_devastator_remote_jump_force 0 set g_balance_devastator_remote_jump_radius 0 set g_balance_devastator_remote_jump_velocity_z_add 400 set g_balance_devastator_remote_jump_velocity_z_max 1500 @@ -777,15 +778,15 @@ set g_balance_arc_weaponthrowable 1 // }}} // {{{ #21: Heavy Machine Gun set g_balance_hmg_ammo 1 -set g_balance_hmg_damage 10 -set g_balance_hmg_force 5 +set g_balance_hmg_damage 30 +set g_balance_hmg_force 10 set g_balance_hmg_refire 0.05 set g_balance_hmg_reload_ammo 120 set g_balance_hmg_reload_time 1 set g_balance_hmg_solidpenetration 32 -set g_balance_hmg_spread_add 0.01 -set g_balance_hmg_spread_max 0.05 -set g_balance_hmg_spread_min 0.02 +set g_balance_hmg_spread_add 0.005 +set g_balance_hmg_spread_max 0.06 +set g_balance_hmg_spread_min 0.01 set g_balance_hmg_switchdelay_drop 0.2 set g_balance_hmg_switchdelay_raise 0.2 set g_balance_hmg_weaponreplace "" diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index fe3b9ed871..99edec78b8 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -465,6 +465,7 @@ set g_balance_devastator_remote_damage 70 set g_balance_devastator_remote_edgedamage 35 set g_balance_devastator_remote_force 400 set g_balance_devastator_remote_jump_damage 40 +set g_balance_devastator_remote_jump_force 0 set g_balance_devastator_remote_jump_radius 200 set g_balance_devastator_remote_jump_velocity_z_add 500 set g_balance_devastator_remote_jump_velocity_z_max 1500 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index c9bdb2aa36..95ac919b6a 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -399,6 +399,7 @@ set g_balance_devastator_remote_damage 70 set g_balance_devastator_remote_edgedamage 35 set g_balance_devastator_remote_force 350 set g_balance_devastator_remote_jump_damage 70 +set g_balance_devastator_remote_jump_force 0 set g_balance_devastator_remote_jump_radius 0 set g_balance_devastator_remote_jump_velocity_z_add 400 set g_balance_devastator_remote_jump_velocity_z_max 1500 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 64d79e150a..87a00b110c 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -325,8 +325,8 @@ set g_balance_vortex_secondary_damagefalloff_maxdist 0 set g_balance_vortex_secondary_damagefalloff_mindist 0 set g_balance_vortex_secondary_force 0 set g_balance_vortex_secondary_refire 0 -set g_balance_vortex_switchdelay_drop 0.25 -set g_balance_vortex_switchdelay_raise 0.25 +set g_balance_vortex_switchdelay_drop 0.2 +set g_balance_vortex_switchdelay_raise 0.2 set g_balance_vortex_weaponreplace "" set g_balance_vortex_weaponstart 0 set g_balance_vortex_weaponstartoverride -1 @@ -399,6 +399,7 @@ set g_balance_devastator_remote_damage 70 set g_balance_devastator_remote_edgedamage 35 set g_balance_devastator_remote_force 300 set g_balance_devastator_remote_jump_damage 70 +set g_balance_devastator_remote_jump_force 0 set g_balance_devastator_remote_jump_radius 0 set g_balance_devastator_remote_jump_velocity_z_add 400 set g_balance_devastator_remote_jump_velocity_z_max 1500 diff --git a/bal-wep-xpm.cfg b/bal-wep-xpm.cfg index 64d79e150a..87a00b110c 100644 --- a/bal-wep-xpm.cfg +++ b/bal-wep-xpm.cfg @@ -325,8 +325,8 @@ set g_balance_vortex_secondary_damagefalloff_maxdist 0 set g_balance_vortex_secondary_damagefalloff_mindist 0 set g_balance_vortex_secondary_force 0 set g_balance_vortex_secondary_refire 0 -set g_balance_vortex_switchdelay_drop 0.25 -set g_balance_vortex_switchdelay_raise 0.25 +set g_balance_vortex_switchdelay_drop 0.2 +set g_balance_vortex_switchdelay_raise 0.2 set g_balance_vortex_weaponreplace "" set g_balance_vortex_weaponstart 0 set g_balance_vortex_weaponstartoverride -1 @@ -399,6 +399,7 @@ set g_balance_devastator_remote_damage 70 set g_balance_devastator_remote_edgedamage 35 set g_balance_devastator_remote_force 300 set g_balance_devastator_remote_jump_damage 70 +set g_balance_devastator_remote_jump_force 0 set g_balance_devastator_remote_jump_radius 0 set g_balance_devastator_remote_jump_velocity_z_add 400 set g_balance_devastator_remote_jump_velocity_z_max 1500 diff --git a/balance-overkill.cfg b/balance-overkill.cfg index 7571001c67..c55241962b 100644 --- a/balance-overkill.cfg +++ b/balance-overkill.cfg @@ -65,15 +65,15 @@ set g_pickup_fuel_jetpack 100 set g_pickup_fuel_max 100 set g_pickup_armorsmall 5 set g_pickup_armorsmall_max 20 -set g_pickup_armorsmall_anyway 0 +set g_pickup_armorsmall_anyway 1 set g_pickup_armormedium 25 -set g_pickup_armormedium_max 200 +set g_pickup_armormedium_max 100 set g_pickup_armormedium_anyway 1 set g_pickup_armorbig 50 -set g_pickup_armorbig_max 200 +set g_pickup_armorbig_max 100 set g_pickup_armorbig_anyway 1 set g_pickup_armorlarge 100 -set g_pickup_armorlarge_max 200 +set g_pickup_armorlarge_max 100 set g_pickup_armorlarge_anyway 1 set g_pickup_healthsmall 5 set g_pickup_healthsmall_max 200 @@ -119,12 +119,12 @@ set g_balance_armor_regen 0 set g_balance_armor_regenlinear 0 set g_balance_armor_rot 0 set g_balance_armor_rotlinear 1 -set g_balance_pause_armor_rot 1 +set g_balance_pause_armor_rot 5 set g_balance_pause_armor_rot_spawn 5 set g_balance_armor_regenstable 100 set g_balance_armor_rotstable 0 set g_balance_armor_limit 999 -set g_balance_armor_blockpercent 0.7 +set g_balance_armor_blockpercent 0.6 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)" set g_balance_fuel_regenlinear 0 set g_balance_pause_fuel_regen 2 // other than this, fuel uses the health regen counter diff --git a/notifications.cfg b/notifications.cfg index 6aa1ee3b7d..8583592b9a 100644 --- a/notifications.cfg +++ b/notifications.cfg @@ -102,7 +102,7 @@ seta notification_ANNCE_VOTE_ACCEPT "2" "0 = disabled, 1 = enabled if gentle mod seta notification_ANNCE_VOTE_CALL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled" seta notification_ANNCE_VOTE_FAIL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled" -// MSG_INFO notifications (count = 316): +// MSG_INFO notifications (count = 320): seta notification_INFO_CA_JOIN_LATE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_CA_LEAVE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_CHAT_NOSPECTATORS "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" @@ -311,6 +311,10 @@ seta notification_INFO_LMS_FORFEIT "1" "0 = off, 1 = print to console, 2 = print seta notification_INFO_LMS_NOLIVES "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_MINIGAME_INVITE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_MONSTERS_DISABLED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" +seta notification_INFO_NEXBALL_RETURN_HELD_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" +seta notification_INFO_NEXBALL_RETURN_HELD_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" +seta notification_INFO_NEXBALL_RETURN_HELD_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" +seta notification_INFO_NEXBALL_RETURN_HELD_YELLOW "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_ONSLAUGHT_CAPTURE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_ONSLAUGHT_CPDESTROYED_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_ONSLAUGHT_CPDESTROYED_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" @@ -882,4 +886,4 @@ seta notification_show_sprees_info "3" "Show spree information in MSG_INFO messa seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself" seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement" -// Notification counts (total = 816): MSG_ANNCE = 89, MSG_INFO = 316, MSG_CENTER = 230, MSG_MULTI = 153, MSG_CHOICE = 28 +// Notification counts (total = 820): MSG_ANNCE = 89, MSG_INFO = 320, MSG_CENTER = 230, MSG_MULTI = 153, MSG_CHOICE = 28 diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 5b80690101..f67cbffbd0 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -1,6 +1,7 @@ #include "centerprint.qh" #include "scoreboard.qh" +#include // CenterPrint (#16) @@ -246,6 +247,9 @@ void HUD_CenterPrint () else // Expiring soon, so fade it out. a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out); + if(centerprint_msgID[j] == CPID_TIMEIN) + a = 1; + // while counting down show it anyway in order to hold the current message position if (a <= 0.5/255.0 && centerprint_countdown_num[j] == 0) // Guaranteed invisible - don't show. continue; diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 17ee08e7cf..a89e84a037 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -11,43 +11,43 @@ MACRO_END MACRO_END // #define PROP(public, fld, set, sv, cl) -#define ENTCS_NETPROPS(PROP) PROP(false, sv_entnum, ENTCS_SET_NORMAL, {}, {}) /* sentinel */ \ +#define ENTCS_NETPROPS(ent, PROP) PROP(false, sv_entnum, ENTCS_SET_NORMAL, {}, {}) /* sentinel */ \ PROP(false, origin, ENTCS_SET_NORMAL, \ - { WriteShort(chan, this.origin.x); WriteShort(chan, this.origin.y); \ - WriteShort(chan, this.origin.z); }, \ - { this.has_sv_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(this, v); }) \ + { WriteShort(chan, ent.origin.x); WriteShort(chan, ent.origin.y); \ + WriteShort(chan, ent.origin.z); }, \ + { ent.has_sv_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(ent, v); }) \ \ PROP(false, angles_y, ENTCS_SET_NORMAL, \ - { WriteByte(chan, this.angles.y / 360 * 256); }, \ - { vector v = '0 0 0'; v.y = ReadByte() / 256 * 360; this.angles = v; }) \ + { WriteByte(chan, ent.angles.y / 360 * 256); }, \ + { vector v = '0 0 0'; v.y = ReadByte() / 256 * 360; ent.angles = v; }) \ \ PROP(false, health, ENTCS_SET_NORMAL, \ - { WriteByte(chan, bound(0, this.health / 10, 255)); /* FIXME: use a better scale? */ }, \ - { this.healthvalue = ReadByte() * 10; }) \ + { WriteByte(chan, bound(0, ent.health / 10, 255)); /* FIXME: use a better scale? */ }, \ + { ent.healthvalue = ReadByte() * 10; }) \ \ PROP(false, armorvalue, ENTCS_SET_NORMAL, \ - { WriteByte(chan, bound(0, this.armorvalue / 10, 255)); /* FIXME: use a better scale? */ }, \ - { this.armorvalue = ReadByte() * 10; }) \ + { WriteByte(chan, bound(0, ent.armorvalue / 10, 255)); /* FIXME: use a better scale? */ }, \ + { ent.armorvalue = ReadByte() * 10; }) \ \ PROP(true, netname, ENTCS_SET_MUTABLE_STRING, \ - { WriteString(chan, this.netname); }, \ - { if (this.netname) strunzone(this.netname); this.netname = strzone(ReadString()); }) \ + { WriteString(chan, ent.netname); }, \ + { if (ent.netname) strunzone(ent.netname); ent.netname = strzone(ReadString()); }) \ \ PROP(true, model, ENTCS_SET_NORMAL, \ - { WriteString(chan, this.model); }, \ - { if (this.model) strunzone(this.model); this.model = strzone(ReadString()); }) \ + { WriteString(chan, ent.model); }, \ + { if (ent.model) strunzone(ent.model); ent.model = strzone(ReadString()); }) \ \ PROP(true, skin, ENTCS_SET_NORMAL, \ - { WriteByte(chan, this.skin); }, \ - { this.skin = ReadByte(); }) \ + { WriteByte(chan, ent.skin); }, \ + { ent.skin = ReadByte(); }) \ \ PROP(true, clientcolors, ENTCS_SET_NORMAL, \ - { WriteByte(chan, this.clientcolors); }, \ - { this.colormap = ReadByte(); }) \ + { WriteByte(chan, ent.clientcolors); }, \ + { ent.colormap = ReadByte(); }) \ \ PROP(true, frags, ENTCS_SET_NORMAL, \ - { WriteShort(chan, this.frags); }, \ - { this.frags = ReadShort(); }) \ + { WriteShort(chan, ent.frags); }, \ + { ent.frags = ReadShort(); }) \ \ /**/ @@ -63,7 +63,7 @@ MACRO_END } \ i += 1; \ } - ENTCS_NETPROPS(X); + ENTCS_NETPROPS(this, X); #undef X if (i >= BITS(16 - 1)) LOG_FATAL("Exceeded ENTCS_NETPROPS limit"); } @@ -93,7 +93,7 @@ MACRO_END } \ i += 1; \ } - ENTCS_NETPROPS(X); + ENTCS_NETPROPS(this, X); #undef X return true; } @@ -115,7 +115,7 @@ MACRO_END } \ i += 1; \ } - ENTCS_NETPROPS(X); + ENTCS_NETPROPS(this, X); #undef X setorigin(this, this.origin); // relink } @@ -214,7 +214,7 @@ MACRO_END } \ i += 1; \ } - ENTCS_NETPROPS(X); + ENTCS_NETPROPS(e, X); #undef X e.iflags |= IFLAG_ORIGIN; InterpolateOrigin_Note(e); diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 1d2555e95e..163d7b81cb 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -103,9 +103,9 @@ void nexball_setstatus(entity this) { if(this.ballcarried.teamtime && (this.ballcarried.teamtime < time)) { - bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n"); - DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0'); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_NEXBALL_RETURN_HELD)); entity e = this.ballcarried; + DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0'); ResetBall(e); } else @@ -255,7 +255,7 @@ void ResetBall(entity this) if(this.cnt < 2) // step 1 { if(time == this.teamtime) - bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n"); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_NEXBALL_RETURN_HELD)); settouch(this, func_null); set_movetype(this, MOVETYPE_NOCLIP); diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index d6606a370b..a18ce34c5d 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -1685,7 +1685,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) { if(SAME_TEAM(tmp_entity, player)) if(random_target) - RandomSelection_Add(tmp_entity, 0, string_null, 1, 1); + RandomSelection_AddEnt(tmp_entity, 1, 1); else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL) closest_target = tmp_entity; } @@ -1732,7 +1732,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) for(tmp_entity = ons_worldgeneratorlist; tmp_entity; tmp_entity = tmp_entity.ons_worldgeneratornext) { if(random_target) - RandomSelection_Add(tmp_entity, 0, string_null, 1, 1); + RandomSelection_AddEnt(tmp_entity, 1, 1); else { if(SAME_TEAM(tmp_entity, player)) diff --git a/qcsrc/common/minigames/minigame/snake.qc b/qcsrc/common/minigames/minigame/snake.qc index c15ecd463b..7f0fdb2ff7 100644 --- a/qcsrc/common/minigames/minigame/snake.qc +++ b/qcsrc/common/minigames/minigame/snake.qc @@ -95,7 +95,7 @@ void snake_new_mouse(entity minigame) { string pos = minigame_tile_buildname(i, j); if(!snake_find_piece(minigame, pos)) - RandomSelection_Add(NULL, 0, pos, 1, 1); + RandomSelection_AddString(pos, 1, 1); } entity piece = msle_spawn(minigame,"minigame_board_piece"); @@ -175,7 +175,7 @@ void minigame_setup_snake(entity minigame, int pteam) { string pos = minigame_tile_buildname(i, j); if(!snake_find_piece(minigame, pos)) - RandomSelection_Add(NULL, 0, pos, 1, 1); + RandomSelection_AddString(pos, 1, 1); } entity piece = msle_spawn(minigame,"minigame_board_piece"); diff --git a/qcsrc/common/minigames/minigame/ttt.qc b/qcsrc/common/minigames/minigame/ttt.qc index e06bb46628..c5a658054f 100644 --- a/qcsrc/common/minigames/minigame/ttt.qc +++ b/qcsrc/common/minigames/minigame/ttt.qc @@ -418,7 +418,7 @@ int ttt_ai_random(int piecemask) for ( int i = 0; i < 9; i++ ) { if ( piecemask & f ) - RandomSelection_Add(NULL, f, string_null, 1, 1); + RandomSelection_AddFloat(f, 1, 1); f <<= 1; } diff --git a/qcsrc/common/monsters/sv_spawn.qc b/qcsrc/common/monsters/sv_spawn.qc index da924cf96b..9e87e488e6 100644 --- a/qcsrc/common/monsters/sv_spawn.qc +++ b/qcsrc/common/monsters/sv_spawn.qc @@ -24,7 +24,7 @@ entity spawnmonster (string monster, int monster_id, entity spawnedby, entity ow RandomSelection_Init(); FOREACH(Monsters, it != MON_Null, { - RandomSelection_Add(it, 0, string_null, 1, 1); + RandomSelection_AddEnt(it, 1, 1); }); monster_id = RandomSelection_chosen_ent.monsterid; diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 82fa2d33cb..5587da5937 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -216,7 +216,7 @@ void buff_NewType(entity ent, float cb) FOREACH(Buffs, buff_Available(it), LAMBDA( it.buff_seencount += 1; // if it's already been chosen, give it a lower priority - RandomSelection_Add(NULL, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount)); + RandomSelection_AddFloat(it.m_itemid, 1, max(0.2, 1 / it.buff_seencount)); )); ent.buffs = RandomSelection_chosen_float; } diff --git a/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc b/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc index e07034bafa..a834749984 100644 --- a/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc +++ b/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc @@ -1,8 +1,8 @@ #include "sv_melee_only.qh" -REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !g_nexball); +REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !cvar("g_overkill") && !g_nexball); -MUTATOR_HOOKFUNCTION(melee_only, SetStartItems) +MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST) { start_ammo_shells = warmup_start_ammo_shells = 0; start_weapons = warmup_start_weapons = WEPSET(SHOTGUN); diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 02760045c3..b0c0e582aa 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -211,7 +211,7 @@ void napalm_damage(entity this, float dist, float damage, float edgedamage, floa if(d < dist) { e.fireball_impactvec = p; - RandomSelection_Add(e, 0, string_null, 1 / (1 + d), !Fire_IsBurning(e)); + RandomSelection_AddEnt(e, 1 / (1 + d), !Fire_IsBurning(e)); } } if(RandomSelection_chosen_ent) diff --git a/qcsrc/common/mutators/mutator/nix/sv_nix.qc b/qcsrc/common/mutators/mutator/nix/sv_nix.qc index 97ed4361ba..39072cefc7 100644 --- a/qcsrc/common/mutators/mutator/nix/sv_nix.qc +++ b/qcsrc/common/mutators/mutator/nix/sv_nix.qc @@ -96,7 +96,7 @@ void NIX_ChooseNextWeapon() RandomSelection_Init(); FOREACH(Weapons, it != WEP_Null, LAMBDA( if(NIX_CanChooseWeapon(it.m_id)) - RandomSelection_Add(NULL, it.m_id, string_null, 1, (it.m_id != nix_weapon)); + RandomSelection_AddFloat(it.m_id, 1, (it.m_id != nix_weapon)); )); nix_nextweapon = RandomSelection_chosen_float; } diff --git a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc index ea7ed953ce..f86c71b7eb 100644 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@ -21,8 +21,6 @@ float autocvar_g_overkill_ammo_charge_limit; .float ok_use_ammocharge = _STAT(OK_AMMO_CHARGE); .float ok_ammo_charge = _STAT(OK_AMMO_CHARGEPOOL); -.float ok_pauseregen_finished; - void(entity ent, float wep) ok_DecreaseCharge; void ok_Initialize(); @@ -109,22 +107,13 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDamage_Calculate, CBC_ORDER_LAST) if(!IS_DEAD(frag_target)) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); - M_ARGV(6, vector) = '0 0 0'; + M_ARGV(6, vector) = '0 0 0'; // force } - M_ARGV(4, float) = 0; + M_ARGV(4, float) = 0; // damage } } -MUTATOR_HOOKFUNCTION(ok, PlayerDamage_SplitHealthArmor) -{ - entity frag_target = M_ARGV(2, entity); - float damage_take = M_ARGV(4, float); - - if(damage_take) - frag_target.ok_pauseregen_finished = max(frag_target.ok_pauseregen_finished, time + 2); -} - void ok_DropItem(entity this, entity targ) { entity e = new(droppedweapon); // hax @@ -168,30 +157,6 @@ MUTATOR_HOOKFUNCTION(ok, MonsterDropItem) ok_DropItem(mon, frag_attacker); } -MUTATOR_HOOKFUNCTION(ok, PlayerRegen) -{ - entity player = M_ARGV(0, entity); - - // overkill's values are different, so use custom regen - if(!STAT(FROZEN, player)) - { - player.armorvalue = CalcRotRegen(player.armorvalue, autocvar_g_balance_armor_regenstable, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, - 1 * frametime * (time > player.ok_pauseregen_finished), 0, 0, 1, 1 * frametime * (time > player.pauserotarmor_finished), autocvar_g_balance_armor_limit); - player.health = CalcRotRegen(player.health, autocvar_g_balance_health_regenstable, 0, 100, 1 * frametime * (time > player.ok_pauseregen_finished), 200, 0, - autocvar_g_balance_health_rotlinear, 1 * frametime * (time > player.pauserothealth_finished), autocvar_g_balance_health_limit); - - float minf, maxf, limitf; - - maxf = autocvar_g_balance_fuel_rotstable; - minf = autocvar_g_balance_fuel_regenstable; - limitf = autocvar_g_balance_fuel_limit; - - player.ammo_fuel = CalcRotRegen(player.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, - frametime * (time > player.pauseregen_finished) * ((player.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > player.pauserotfuel_finished), limitf); - } - return true; // return true anyway, as frozen uses no regen -} - MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon) { return true; @@ -221,7 +186,8 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) ok_IncreaseCharge(player, PS(player).m_weapon.m_id); if(PHYS_INPUT_BUTTON_ATCK2(player)) - if(!forbidWeaponUse(player) || player.weapon_blocked) // allow if weapon is blocked + if( !forbidWeaponUse(player) || player.weapon_blocked // allow if weapon is blocked + || (round_handler_IsActive() && !round_handler_IsRoundStarted()) ) if(time >= player.jump_interval) { player.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(player); @@ -287,8 +253,6 @@ MUTATOR_HOOKFUNCTION(ok, PlayerSpawn) // if player changed their weapon while dead, don't switch to their death weapon if(player.impulse) player.ok_lastwep = 0; - - player.ok_pauseregen_finished = time + 2; } void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); } @@ -362,7 +326,7 @@ MUTATOR_HOOKFUNCTION(ok, SpectateCopy) client.ok_use_ammocharge = spectatee.ok_use_ammocharge; } -MUTATOR_HOOKFUNCTION(ok, SetStartItems) +MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST) { WepSet ok_start_items = (WEPSET(MACHINEGUN) | WEPSET(VORTEX) | WEPSET(SHOTGUN)); diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc b/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc index 26a6c509b1..2e4802d388 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc @@ -38,7 +38,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score) continue; if(!checkpvs(spawn_spot.origin, it)) continue; - RandomSelection_Add(it, 0, string_null, 1, 1); + RandomSelection_AddEnt(it, 1, 1); )); if(RandomSelection_chosen_ent) diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index e6be6b1007..a6431cf673 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -387,6 +387,8 @@ MSG_INFO_NOTIF(MONSTERS_DISABLED, 1, 0, 0, "", "", "", _("^BGMonsters are currently disabled"), "") + MULTITEAM_INFO(NEXBALL_RETURN_HELD, 4, 1, 0, 0, "", "", "", _("^BGThe ^TC^TT^BG team held the ball for too long"), "", NAME) + MSG_INFO_NOTIF(ONSLAUGHT_CAPTURE, 1, 2, 0, "s1 s2", "", "", _("^BG%s^BG captured %s^BG control point"), "") MULTITEAM_INFO(ONSLAUGHT_CPDESTROYED, 4, 1, 2, 0, "s1 s2", "", "", _("^TC^TT^BG team %s^BG control point has been destroyed by %s"), "", NAME) MULTITEAM_INFO(ONSLAUGHT_GENDESTROYED, 4, 1, 0, 0, "", "", "", _("^TC^TT^BG generator has been destroyed"), "", GENERATOR) @@ -742,7 +744,7 @@ MSG_CENTER_NOTIF(TEAMCHANGE_SUICIDE, 1, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "") MSG_CENTER_NOTIF(TIMEOUT_BEGINNING, 1, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "") - MSG_CENTER_NOTIF(TIMEOUT_ENDING, 1, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "") + MSG_CENTER_NOTIF(TIMEOUT_ENDING, 1, 0, 1, "", CPID_TIMEIN, "1 f1", _("^F4Timeout ends in ^COUNT"), "") MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME, 1, 0, 0, "", CPID_Null, "0 0", _("^K1Cannot join given minigame session!"), "" ) diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index e7a02dd659..d2682a148f 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -65,6 +65,7 @@ ENUMCLASS(CPID) CASE(CPID, RACE_FINISHLAP) CASE(CPID, TEAMCHANGE) CASE(CPID, TIMEOUT) + CASE(CPID, TIMEIN) CASE(CPID, VEHICLES) CASE(CPID, VEHICLES_OTHER) /** always last */ diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index f9f89a73fa..7424d695aa 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -840,7 +840,7 @@ LABEL(pickup) if(it.classname != "item_flag_team" && it.classname != "item_kh_key") { Item_Show(it, -1); - RandomSelection_Add(it, 0, string_null, it.cnt, 0); + RandomSelection_AddEnt(it, it.cnt, 0); } }); e = RandomSelection_chosen_ent; @@ -882,7 +882,7 @@ void Item_FindTeam(entity this) IL_EACH(g_items, it.team == this.team, { if(it.classname != "item_flag_team" && it.classname != "item_kh_key") - RandomSelection_Add(it, 0, string_null, it.cnt, 0); + RandomSelection_AddEnt(it, it.cnt, 0); }); e = RandomSelection_chosen_ent; diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index b5e97b1fc7..949f478fdd 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -92,7 +92,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle RandomSelection_Init(); FOREACH_WORD(teleporter.noise, true, { - RandomSelection_Add(NULL, 0, it, 1, 1); + RandomSelection_AddString(it, 1, 1); }); thesound = RandomSelection_chosen_string; } @@ -198,7 +198,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) if(check_tdeath(player, locout, '0 0 0', '0 0 0')) p = 0; } - RandomSelection_Add(it, 0, string_null, (it.cnt ? it.cnt : 1), p); + RandomSelection_AddEnt(it, (it.cnt ? it.cnt : 1), p); }); e = RandomSelection_chosen_ent; } diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index ef13dd5bec..498f0ff2db 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -155,9 +155,9 @@ void trigger_push_touch(entity this, entity toucher) for(e = NULL; (e = find(e, targetname, this.target)); ) { if(e.cnt) - RandomSelection_Add(e, 0, string_null, e.cnt, 1); + RandomSelection_AddEnt(e, e.cnt, 1); else - RandomSelection_Add(e, 0, string_null, 1, 1); + RandomSelection_AddEnt(e, 1, 1); } toucher.velocity = trigger_push_calculatevelocity(toucher.origin, RandomSelection_chosen_ent, this.height); } diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 54e1e09919..8a63e3b683 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -260,7 +260,7 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe { if(this.target_random) { - RandomSelection_Add(t, 0, string_null, 1, 0); + RandomSelection_AddEnt(t, 1, 0); } else { diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index cf55aa6521..763dd6e8de 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -204,7 +204,7 @@ void W_RandomWeapons(entity e, float n) RandomSelection_Init(); FOREACH(Weapons, it != WEP_Null, { if (remaining & (it.m_wepset)) - RandomSelection_Add(it, 0, string_null, 1, 1); + RandomSelection_AddEnt(it, 1, 1); }); Weapon w = RandomSelection_chosen_ent; result |= WepSet_FromWeapon(w); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 1fdb8d6ad6..df9bd470a3 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -40,6 +40,7 @@ CLASS(Devastator, Weapon) P(class, prefix, remote_edgedamage, float, NONE) \ P(class, prefix, remote_force, float, NONE) \ P(class, prefix, remote_jump_damage, float, NONE) \ + P(class, prefix, remote_jump_force, float, NONE) \ P(class, prefix, remote_jump_radius, float, NONE) \ P(class, prefix, remote_jump_velocity_z_add, float, NONE) \ P(class, prefix, remote_jump_velocity_z_max, float, NONE) \ @@ -141,50 +142,56 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - float handled_as_rocketjump = false; + bool handled_as_rocketjump = false; + entity head = NULL; - entity head = WarpZone_FindRadius( - this.origin, - WEP_CVAR(devastator, remote_jump_radius), - false - ); - - while(head) + if(WEP_CVAR(devastator, remote_jump_radius)) { - if(head.takedamage && (head == this.realowner)) + head = WarpZone_FindRadius( + this.origin, + WEP_CVAR(devastator, remote_jump_radius), + false + ); + + while(head) { - float distance_to_head = vlen(this.origin - head.WarpZone_findradius_nearest); - if(distance_to_head <= WEP_CVAR(devastator, remote_jump_radius)) + if(head.takedamage && (head == this.realowner)) { - // we handled this as a rocketjump :) - handled_as_rocketjump = true; - - // modify velocity - head.velocity_x *= 0.9; - head.velocity_y *= 0.9; - head.velocity_z = bound( - WEP_CVAR(devastator, remote_jump_velocity_z_min), - head.velocity.z + WEP_CVAR(devastator, remote_jump_velocity_z_add), - WEP_CVAR(devastator, remote_jump_velocity_z_max) - ); - - // now do the damage - RadiusDamage( - this, - head, - WEP_CVAR(devastator, remote_jump_damage), - WEP_CVAR(devastator, remote_jump_damage), - WEP_CVAR(devastator, remote_jump_radius), - NULL, - head, - 0, - this.projectiledeathtype | HITTYPE_BOUNCE, - NULL - ); - break; + if(vdist(this.origin - head.WarpZone_findradius_nearest, <=, WEP_CVAR(devastator, remote_jump_radius))) + { + // we handled this as a rocketjump :) + handled_as_rocketjump = true; + + // modify velocity + if(WEP_CVAR(devastator, remote_jump_velocity_z_add)) + { + head.velocity_x *= 0.9; + head.velocity_y *= 0.9; + head.velocity_z = bound( + WEP_CVAR(devastator, remote_jump_velocity_z_min), + head.velocity.z + WEP_CVAR(devastator, remote_jump_velocity_z_add), + WEP_CVAR(devastator, remote_jump_velocity_z_max) + ); + } + + // now do the damage + RadiusDamage( + this, + head, + WEP_CVAR(devastator, remote_jump_damage), + WEP_CVAR(devastator, remote_jump_damage), + WEP_CVAR(devastator, remote_jump_radius), + NULL, + head, + (WEP_CVAR(devastator, remote_jump_force) ? WEP_CVAR(devastator, remote_jump_force) : 0), + this.projectiledeathtype | HITTYPE_BOUNCE, + NULL + ); + break; + } } + head = head.chain; } - head = head.chain; } RadiusDamage( diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index c2b93747c8..ae1e48bb2c 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -150,7 +150,7 @@ void W_Fireball_LaserPlay(entity this, float dt, float dist, float damage, float if(d < dist) { e.fireball_impactvec = p; - RandomSelection_Add(e, 0, string_null, 1 / (1 + d), !Fire_IsBurning(e)); + RandomSelection_AddEnt(e, 1 / (1 + d), !Fire_IsBurning(e)); } } if(RandomSelection_chosen_ent) diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 23e7c23ae5..ba7efe6a31 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -383,13 +383,16 @@ void Draw_GrapplingHook(entity this) break; } - if((this.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0) + if((this.owner.sv_entnum == player_localentnum - 1)) { switch(this.HookType) { default: case NET_ENT_CLIENT_HOOK: - a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; + if(autocvar_chase_active > 0) + a = csqcplayer.origin; + else + a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; b = this.origin; break; case NET_ENT_CLIENT_ARC_BEAM: diff --git a/qcsrc/lib/random.qc b/qcsrc/lib/random.qc index 2287d869d0..627fec11a9 100644 --- a/qcsrc/lib/random.qc +++ b/qcsrc/lib/random.qc @@ -9,7 +9,7 @@ void RandomSelection_Init() RandomSelection_best_priority = -1; } -void RandomSelection_Add(entity e, float f, string s, float weight, float priority) +void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority) { if (priority > RandomSelection_best_priority) { @@ -17,6 +17,7 @@ void RandomSelection_Add(entity e, float f, string s, float weight, float priori RandomSelection_chosen_ent = e; RandomSelection_chosen_float = f; RandomSelection_chosen_string = s; + RandomSelection_chosen_vec = v; RandomSelection_totalweight = weight; } else if (priority == RandomSelection_best_priority) @@ -27,6 +28,7 @@ void RandomSelection_Add(entity e, float f, string s, float weight, float priori RandomSelection_chosen_ent = e; RandomSelection_chosen_float = f; RandomSelection_chosen_string = s; + RandomSelection_chosen_vec = v; } } } diff --git a/qcsrc/lib/random.qh b/qcsrc/lib/random.qh index 1834a97a33..b2fc53f0ca 100644 --- a/qcsrc/lib/random.qh +++ b/qcsrc/lib/random.qh @@ -5,9 +5,14 @@ float RandomSelection_best_priority; entity RandomSelection_chosen_ent; float RandomSelection_chosen_float; string RandomSelection_chosen_string; +vector RandomSelection_chosen_vec; void RandomSelection_Init(); -void RandomSelection_Add(entity e, float f, string s, float weight, float priority); +void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority); +#define RandomSelection_AddEnt(e, weight, priority) RandomSelection_Add(e, 0, string_null, '0 0 0', weight, priority) +#define RandomSelection_AddFloat(f, weight, priority) RandomSelection_Add(NULL, f, string_null, '0 0 0', weight, priority) +#define RandomSelection_AddString(s, weight, priority) RandomSelection_Add(NULL, 0, s, '0 0 0', weight, priority) +#define RandomSelection_AddVec(v, weight, priority) RandomSelection_Add(NULL, 0, string_null, v, weight, priority) // prandom - PREDICTABLE random number generator diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index ca12d0d651..bdde55b9aa 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -177,7 +177,7 @@ void bot_setnameandstuff(entity this) break; } )); - RandomSelection_Add(NULL, 0, readfile, 1, prio); + RandomSelection_AddString(readfile, 1, prio); } readfile = RandomSelection_chosen_string; fclose(file); diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 9f763a886d..543a3f98d2 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -262,7 +262,7 @@ float CheatImpulse(entity this, int imp) case CHIMPULSE_R00T.impulse: IS_CHEAT(this, imp, 0, 0); RandomSelection_Init(); - FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_Add(it, 0, string_null, 1, 1))); + FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_AddEnt(it, 1, 1))); if(RandomSelection_chosen_ent) e = RandomSelection_chosen_ent; else @@ -475,9 +475,9 @@ float CheatCommand(entity this, int argc) RandomSelection_Init(); crosshair_trace(this); for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); if(RandomSelection_chosen_ent) { delete(RandomSelection_chosen_ent.killindicator.killindicator); @@ -497,9 +497,9 @@ float CheatCommand(entity this, int argc) RandomSelection_Init(); crosshair_trace(this); for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); if(RandomSelection_chosen_ent) { if(substring(argv(1), 0, 1) == "*") diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 35418a02f0..ec1f9c89fa 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -210,6 +210,7 @@ void timeout_handler_think(entity this) } else // time to end the timeout { + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_TIMEIN); timeout_status = TIMEOUT_INACTIVE; // reset the slowmo value back to normal diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index fe7822bc16..be21020d4d 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1503,7 +1503,7 @@ void FixIntermissionClient(entity e) stuffcmd(e, "\nscr_printspeed 1000000\n"); RandomSelection_Init(); FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, LAMBDA( - RandomSelection_Add(NULL, 0, it, 1, 1); + RandomSelection_AddString(it, 1, 1); )); if (RandomSelection_chosen_string != "") { diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 29768893a7..7c7c02018c 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -522,7 +522,7 @@ float MapVote_CheckRules_2() for(i = 0; i < mapvote_count_real; ++i) if ( mapvote_maps_flags[i] & GTV_AVAILABLE ) { - RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]); + RandomSelection_AddFloat(i, 1, mapvote_selections[i]); if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) ) { currentVotes = mapvote_selections[i]; @@ -542,7 +542,7 @@ float MapVote_CheckRules_2() for(i = 0; i < mapvote_count_real; ++i) if(i != firstPlace) if ( mapvote_maps_flags[i] & GTV_AVAILABLE ) - RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]); + RandomSelection_AddFloat(i, 1, mapvote_selections[i]); secondPlace = RandomSelection_chosen_float; secondPlaceVotes = RandomSelection_best_priority; //dprint("Second place: ", ftos(secondPlace), "\n"); diff --git a/qcsrc/server/mutators/mutator/gamemode_invasion.qc b/qcsrc/server/mutators/mutator/gamemode_invasion.qc index 61fe75ea49..a057408b96 100644 --- a/qcsrc/server/mutators/mutator/gamemode_invasion.qc +++ b/qcsrc/server/mutators/mutator/gamemode_invasion.qc @@ -45,7 +45,7 @@ int invasion_PickMonster(int supermonster_count) { if((it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM) || (it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1)) continue; - RandomSelection_Add(NULL, it.monsterid, string_null, 1, 1); + RandomSelection_AddFloat(it.monsterid, 1, 1); }); return RandomSelection_chosen_float; @@ -57,7 +57,7 @@ entity invasion_PickSpawn() IL_EACH(g_invasion_spawns, true, { - RandomSelection_Add(it, 0, string_null, 1, ((time >= it.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating + RandomSelection_AddEnt(it, 1, ((time >= it.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating it.spawnshieldtime = time + autocvar_g_invasion_spawnpoint_spawn_delay; }); @@ -96,10 +96,10 @@ void invasion_SpawnChosenMonster(int mon) else { RandomSelection_Init(); - if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_Add(NULL, NUM_TEAM_1, string_null, 1, 1); - if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(NULL, NUM_TEAM_2, string_null, 1, 1); - if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(NULL, NUM_TEAM_3, string_null, 1, 1); } - if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(NULL, NUM_TEAM_4, string_null, 1, 1); } + if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_AddFloat(NUM_TEAM_1, 1, 1); + if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_AddFloat(NUM_TEAM_2, 1, 1); + if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_AddFloat(NUM_TEAM_3, 1, 1); } + if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_AddFloat(NUM_TEAM_4, 1, 1); } monster.team = RandomSelection_chosen_float; } diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 59cc052af4..18d32c2f06 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -317,7 +317,7 @@ entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exp RandomSelection_Init(); for(spot = firstspot; spot; spot = spot.chain) - RandomSelection_Add(spot, 0, string_null, pow(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x); + RandomSelection_AddEnt(spot, pow(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x); return RandomSelection_chosen_ent; } diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 6ccb7d4081..4632866b48 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -508,13 +508,13 @@ float FindSmallestTeam(entity pl, float ignore_pl) // now t is the minimum, or A minimum! if(t == 1 || TeamSmallerEqThanTeam(1, t, pl)) - RandomSelection_Add(NULL, 1, string_null, 1, 1); + RandomSelection_AddFloat(1, 1, 1); if(t == 2 || TeamSmallerEqThanTeam(2, t, pl)) - RandomSelection_Add(NULL, 2, string_null, 1, 1); + RandomSelection_AddFloat(2, 1, 1); if(t == 3 || TeamSmallerEqThanTeam(3, t, pl)) - RandomSelection_Add(NULL, 3, string_null, 1, 1); + RandomSelection_AddFloat(3, 1, 1); if(t == 4 || TeamSmallerEqThanTeam(4, t, pl)) - RandomSelection_Add(NULL, 4, string_null, 1, 1); + RandomSelection_AddFloat(4, 1, 1); return RandomSelection_chosen_float; }