]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/universal_reload_system
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Feb 2011 14:32:47 +0000 (16:32 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Feb 2011 14:32:47 +0000 (16:32 +0200)
Conflicts:
qcsrc/common/constants.qh

24 files changed:
balanceSamual.cfg
defaultXonotic.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_xhair_minimal.cfg
hud_nexuiz.cfg
menu.dat.de.po
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/menu/xonotic/dialog_multiplayer_join.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/nexball.qc
qcsrc/server/t_plats.qc

index 02f16775fc3dde1c8e4ecad142e402a025658c68..83a1db0a7cab6a242bc5760f354b19cb0710e4f2 100644 (file)
@@ -17,7 +17,7 @@ set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always prov
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_balance_health_start 150
+set g_balance_health_start 100
 set g_balance_armor_start 0
 set g_start_ammo_shells 15
 set g_start_ammo_nails 0
@@ -487,7 +487,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 
 set g_balance_nex_charge 1
 set g_balance_nex_charge_mindmg 40
-set g_balance_nex_charge_start 0
+set g_balance_nex_charge_start 0.5
 set g_balance_nex_charge_rate 0.3
 set g_balance_nex_charge_animlimit 0.5
 set g_balance_nex_charge_limit 1
@@ -534,13 +534,13 @@ set g_balance_rocketlauncher_speed 1500
 set g_balance_rocketlauncher_speedaccel 1500
 set g_balance_rocketlauncher_speedstart 800
 set g_balance_rocketlauncher_lifetime 30
-set g_balance_rocketlauncher_refire 1.2
+set g_balance_rocketlauncher_refire 1.1
 set g_balance_rocketlauncher_animtime 0.3
 set g_balance_rocketlauncher_ammo 3
 set g_balance_rocketlauncher_health 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but grenadelauncher still can most the time.
 set g_balance_rocketlauncher_damageforcescale 4
 set g_balance_rocketlauncher_detonatedelay 0.05 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
-set g_balance_rocketlauncher_guiderate 140 // max degrees per second
+set g_balance_rocketlauncher_guiderate 130 // max degrees per second
 set g_balance_rocketlauncher_guideratedelay 0.01 // immediate
 set g_balance_rocketlauncher_guidegoal 512 // goal distance for (non-laser) guiding (higher = less control, lower = erratic)
 set g_balance_rocketlauncher_guidedelay 0.15 // delay before guiding kicks in
index 05cc6c8931286d0ee81988f4a697f6eaaad336d9..c76176a843fbbff851f86403ba198fb2c3c05f41 100644 (file)
@@ -103,6 +103,9 @@ seta crosshair_dot_size 0.600000
 seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair dot"
 seta crosshair_pickup 0.25
 seta crosshair_pickup_speed 4
+seta crosshair_hitindication 0.5
+seta crosshair_hitindication_color "10 -10 -10"
+seta crosshair_hitindication_speed 5
 seta crosshair_per_weapon 0    "when 1, each gun will display a different crosshair"
 seta crosshair_color_per_weapon 1 "when 1, each gun will display the crosshair with a different color"
 seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time"
@@ -301,7 +304,8 @@ set sv_ready_restart 0 "if set to 1 allow a map to be restarted once all players
 set sv_ready_restart_after_countdown 0 "if set to 1 the players and map items are reset after the countdown ended, otherwise they're reset already at the beginning of the countdown"
 set sv_ready_restart_repeatable 0      "allows the players to restart the game as often as needed"
 
-set sv_hitsound_antispam_time 0.05 "don't play the hitsound more often than this for the electro lightning gun or the laser gauntlet"
+seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy"
+set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"
 
 //nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
 set teamplay_lockonrestart 0 "it set to 1 in a team-based game, the teams are locked once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"
@@ -927,7 +931,6 @@ sv_sound_watersplash ""
 seta cl_sound_maptime_warning "1" "play announcer sound telling you the remaining maptime - 0: do not play at all, 1: play at one minute, 2: play at five minutes, 3: play both"
 seta cl_notify_carried_items "3" "notify you of carried items when you obtain them (e.g. flags in CTF) - 0: disabled, 1: notify of taken items, 2: notify of picking up dropped items, 3: notify of both"
 
-seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy"
 seta cl_announcer default "name of the announcer you wish to use from data/sound/announcer"
 
 // startmap_dm is used when running with the -listen or -dedicated commandline options
index a3f3ed39e51f0dd8961f77f80094f1f600986fd6..ca8ea38de05476976feaf3a64b31755697d7cd44 100644 (file)
@@ -108,6 +108,7 @@ seta hud_panel_notify_bg_alpha ""
 seta hud_panel_notify_bg_border ""
 seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "0"
+seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_print "1"
 
 seta hud_panel_timer 1
@@ -120,7 +121,7 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar 1
+seta hud_panel_radar 2 // enabled for keepaway and to make the HUD consistent throughout game modes
 seta hud_panel_radar_pos "0.030000 0.020000"
 seta hud_panel_radar_size "0.170000 0.220000"
 seta hud_panel_radar_bg ""
index 8e39416314bdf665e1ad59b1cfaf26119ee926a5..fef69f23fd52f73104af2e0f42558d132c931852 100644 (file)
@@ -108,6 +108,7 @@ seta hud_panel_notify_bg_alpha ""
 seta hud_panel_notify_bg_border ""
 seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "1"
+seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_print "0"
 
 seta hud_panel_timer 1
index 10f7afd149822e08d9b99e94521e17373d04dbf3..80fe445e48cb85ecce0e558606e43ac2b74dc14e 100644 (file)
@@ -107,6 +107,7 @@ seta hud_panel_notify_bg_alpha ""
 seta hud_panel_notify_bg_border ""
 seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "1"
+seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_print "0"
 
 seta hud_panel_timer 1
index 681b7378e01fa3ce213ba3b552b2cca169f6913c..cfa50af89acb4dd8add91079c3c9cfcc7a886954 100644 (file)
@@ -108,6 +108,7 @@ seta hud_panel_notify_bg_alpha "0"
 seta hud_panel_notify_bg_border ""
 seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "0"
+seta hud_panel_notify_fontsize "1"
 seta hud_panel_notify_print "1"
 
 seta hud_panel_timer 1
index 238a8f1efb12d3767fa2516c90c0de1fc37b8976..eab0ff082ad0bdd564e26089d59c71621727f9e5 100644 (file)
@@ -2433,7 +2433,7 @@ msgstr "Electro"
 #: qcsrc/server/w_electro.qc:503
 #, c-format
 msgid "%s could not remember where they put plasma"
-msgstr "%s could not remember where they put plasma"
+msgstr "%s konnte sich nicht erinnern, wo das Plasma lag"
 
 #: qcsrc/server/w_electro.qc:505
 #, c-format
@@ -2448,7 +2448,7 @@ msgstr "%s hat gerade %ss blauen Ball bemerkt"
 #: qcsrc/server/w_electro.qc:514
 #, c-format
 msgid "%s got in touch with %s's blue ball"
-msgstr "%s schaute mit den Fingern auf %ss blauen Ball"
+msgstr "%s kam in Kontakt mit %ss blauen Ball"
 
 #: qcsrc/server/w_electro.qc:519
 #, c-format
@@ -2482,7 +2482,7 @@ msgstr "%s hätte eine kleinere Waffe nehmen sollen"
 #: qcsrc/server/w_fireball.qc:401
 #, c-format
 msgid "%s tried to catch %s's firemine"
-msgstr "%s hat versucht, %ss Feuermine zu fangen"
+msgstr "%s hat versucht %ss Feuermine zu fangen"
 
 #: qcsrc/server/w_fireball.qc:403
 #, c-format
index 710c7f7433a7b687a3dab1fa027c675e8795a005..125c6db3122c4e998e49731b0a383af41ce46248 100644 (file)
@@ -136,6 +136,8 @@ void CSQC_Init(void)
        WaypointSprite_Load();
 
        // precaches
+       precache_sound("misc/hit.wav");
+       precache_sound("misc/typehit.wav");
        Projectile_Precache();
        Hook_Precache();
        GibSplash_Precache();
index f91026cf0845cff97e82084ca255e99fd8aecf7e..7fde6824d320e767c30915e640ed50d6fa252df4 100644 (file)
@@ -353,6 +353,9 @@ vector freeze_pmove_org, freeze_input_angles;
 entity nightvision_noise, nightvision_noise2;
 
 float pickup_crosshair_time, pickup_crosshair_size;
+float hit_time, typehit_time;
+float nextsound_hit_time, nextsound_typehit_time;
+float hitindication_crosshair_time, hitindication_crosshair_size;
 float use_nex_chargepool;
 
 float myhealth, myhealth_prev;
@@ -809,6 +812,19 @@ void CSQC_UpdateView(float w, float h)
 
        scoreboard_active = HUD_WouldDrawScoreboard();
 
+       hit_time = getstatf(STAT_HIT_TIME);
+       if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
+       {
+               sound(world, CHAN_AUTO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+               nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
+       }
+       typehit_time = getstatf(STAT_TYPEHIT_TIME);
+       if(typehit_time > nextsound_typehit_time)
+       {
+               sound(world, CHAN_AUTO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+               nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
+       }
+
        float hud;
        hud = getstati(STAT_HUD);
        if(hud == HUD_SPIDERBOT)
@@ -973,6 +989,27 @@ void CSQC_UpdateView(float w, float h)
 
                                wcross_scale += sin(pickup_crosshair_size) * autocvar_crosshair_pickup;
                        }
+                       
+                       vector hitindication_color;
+                       if(autocvar_crosshair_hitindication)
+                       {
+                               hitindication_color = stov(autocvar_crosshair_hitindication_color);
+                               if(hitindication_crosshair_time < hit_time)
+                               {
+                                       hitindication_crosshair_size = 1;
+                                       hitindication_crosshair_time = hit_time;
+                               }
+
+                               if(hitindication_crosshair_size > 0)
+                                       hitindication_crosshair_size -= autocvar_crosshair_hitindication_speed * frametime;
+                               else
+                                       hitindication_crosshair_size = 0;
+
+                               wcross_scale += sin(hitindication_crosshair_size) * autocvar_crosshair_hitindication;
+                               wcross_color_x += sin(hitindication_crosshair_size) * hitindication_color_x;
+                               wcross_color_y += sin(hitindication_crosshair_size) * hitindication_color_y;
+                               wcross_color_z += sin(hitindication_crosshair_size) * hitindication_color_z;
+                       }
 
                        if(shottype == SHOTTYPE_HITENEMY)
                                wcross_scale *= autocvar_crosshair_hittest; // is not queried if hittest is 0
index df78b4f35c3a2dda7f61af5ccef302cb7e48b09d..0cf1e4bf8dc8d5f76652fa0141d269ce66ff358f 100644 (file)
@@ -99,6 +99,9 @@ string autocvar_crosshair_dot_color;
 float autocvar_crosshair_dot_size;
 float autocvar_crosshair_effect_scalefade;
 float autocvar_crosshair_effect_speed;
+float autocvar_crosshair_hitindication;
+string autocvar_crosshair_hitindication_color;
+float autocvar_crosshair_hitindication_speed;
 float autocvar_crosshair_hittest;
 float autocvar_crosshair_hittest_blur;
 float autocvar_crosshair_hittest_showimpact;
@@ -206,6 +209,7 @@ float autocvar_hud_panel_modicons;
 float autocvar_hud_panel_notify;
 float autocvar_hud_panel_notify_fadetime;
 float autocvar_hud_panel_notify_flip;
+float autocvar_hud_panel_notify_fontsize;
 float autocvar_hud_panel_notify_print;
 float autocvar_hud_panel_notify_time;
 float autocvar_hud_panel_powerups;
@@ -291,3 +295,5 @@ float autocvar_vid_conwidth;
 float autocvar_vid_pixelheight;
 float autocvar_viewsize;
 float autocvar_crosshair_color_by_health;
+float autocvar_cl_hitsound;
+float autocvar_cl_hitsound_antispam_time;
index e8309ef4e92a75cfcb633108c2471e9462b6c281..d55cfd86612c76b69034738b7bf0a7d714fe398f 100644 (file)
@@ -3142,7 +3142,8 @@ void HUD_Notify (void)
        height = mySize_y/entries;
        
        vector fontsize;
-       fontsize = '0.5 0.5 0' * height;
+       float fontheight = height * autocvar_hud_panel_notify_fontsize;
+       fontsize = '0.5 0.5 0' * fontheight;
 
        float a;
        float when;
@@ -3316,7 +3317,7 @@ void HUD_Notify (void)
                        }
                        
                        attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
-                       pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
+                       pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
                        weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
 
                        if(s != "")
@@ -3402,8 +3403,8 @@ void HUD_Notify (void)
                        victim = textShortenToWidth(killnotify_victims[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
 :hud_config_notifyprint
                        width_attacker = stringwidth(attacker, TRUE, fontsize);
-                       pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * (0.5 * fontsize_y + i * height);
-                       pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
+                       pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+                       pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
                        weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
 
                        if(s != "")
index da8cfaac1890db4b7d57dd4f6f548e15ed185248..b8c4f44699cf61a95df7230d9b1c1a5602d820be 100644 (file)
@@ -313,6 +313,8 @@ const float STAT_NEX_CHARGE = 50;
 const float STAT_LAST_PICKUP = 51;
 const float STAT_HUD = 52;
 const float STAT_NEX_CHARGEPOOL = 53;
+const float STAT_HIT_TIME = 54;
+const float STAT_TYPEHIT_TIME = 55;
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
index fe9f860c314a3c93592c9e191626fb1cc70554d8..ee451744fb8899942380f76248d7ff8bfa638f51 100644 (file)
@@ -57,6 +57,8 @@ void XonoticServerListTab_fill(entity me)
                me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
                        e.onEnter = ServerList_Connect_Click;
                        e.onEnterEntity = slist;
+                       e.onChange = ServerList_Update_favoriteButton;
+                       e.onChangeEntity = slist;
                        slist.ipAddressBox = e;
                me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
                        e.onClick = ServerList_Favorite_Click;
index fe47fe50f662c7c9c256a965166785702039f4f3..8a804f91f149dad3502871fdd70be56fcdfb6940 100644 (file)
@@ -137,12 +137,13 @@ void XonoticPlayerSettingsTab_fill(entity me)
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair color:"));
                me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", _("Per weapon")));
+                       setDependent(e, "crosshair_color_by_health", 0, 0);
                me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "crosshair_color_by_health", _("By health")));
-               setDependent(e, "crosshair_color_per_weapon", 0, 0);
+                       setDependent(e, "crosshair_color_per_weapon", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
-               setDependentAND(e, "crosshair_color_per_weapon", 0, 0, "crosshair_color_by_health", 0, 0);
+                       setDependentAND(e, "crosshair_color_per_weapon", 0, 0, "crosshair_color_by_health", 0, 0);
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center dot")));
@@ -164,14 +165,11 @@ void XonoticPlayerSettingsTab_fill(entity me)
                me.TD(me, 1, 2.2, e = makeXonoticButton(_("Waypoints setup..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.waypointDialog;
-               me.TDempty(me, 0.5);
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 2.2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
                        e.onClick = HUDSetup_Join_Click;
                        e.onClickEntity = me;
-               me.TDempty(me, 0.5);
-       me.TR(me);
        me.TR(me);
        #ifdef ALLOW_FORCEMODELS
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Force models:")));
index a3d747dabb9b2a1a3a26db9145b2785e82ae9bc3..0e4760e3ff3522af46781e235cc1a8cbfdcd1190 100644 (file)
@@ -63,6 +63,7 @@ void ServerList_ShowFull_Click(entity box, entity me);
 void ServerList_Filter_Change(entity box, entity me);
 void ServerList_Favorite_Click(entity btn, entity me);
 void ServerList_Info_Click(entity btn, entity me);
+void ServerList_Update_favoriteButton(entity btn, entity me);
 #endif
 
 #ifdef IMPLEMENTATION
@@ -178,6 +179,14 @@ void ToggleFavorite(string srv)
        resorthostcache();
 }
 
+void ServerList_Update_favoriteButton(entity btn, entity me)
+{
+       if(IsFavorite(me.ipAddressBox.text))
+               me.favoriteButton.setText(me.favoriteButton, _("Remove"));
+       else
+               me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
+}
+
 entity makeXonoticServerList()
 {
        entity me;
@@ -356,12 +365,7 @@ void XonoticServerList_draw(entity me)
        if(me.ipAddressBoxFocused != me.ipAddressBox.focused)
        {
                if(me.ipAddressBox.focused || me.ipAddressBoxFocused < 0)
-               {
-                       if(IsFavorite(me.ipAddressBox.text))
-                               me.favoriteButton.setText(me.favoriteButton, _("Remove"));
-                       else
-                               me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
-               }
+                       ServerList_Update_favoriteButton(NULL, me);
                me.ipAddressBoxFocused = me.ipAddressBox.focused;
        }
 
index 7c9a533572908add4ee7e5df0456a4904b2beec1..c78460c17391b4cebfdd0cce5f6b8e55a57d5db3 100644 (file)
@@ -832,7 +832,6 @@ float autocvar_g_midair_shieldtime;
 float autocvar_g_minstagib_ammo_drop;
 float autocvar_g_minstagib_extralives;
 float autocvar_g_minstagib_speed_highspeed;
-float autocvar_g_mirrordamage;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
 #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
 float autocvar_g_monster_zombie_attack_run_damage;
@@ -1148,7 +1147,6 @@ float autocvar_sv_friction;
 float autocvar_sv_friction_on_land;
 float autocvar_sv_gameplayfix_q2airaccelerate;
 #define autocvar_sv_gravity cvar("sv_gravity")
-float autocvar_sv_hitsound_antispam_time;
 string autocvar_sv_intermission_cdtrack;
 string autocvar_sv_jumpspeedcap_max;
 float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
index 8b7a23c75069c389500ea890e54601638df28682..c5312469a892864b6dc231f92fc76831a4813da9 100644 (file)
@@ -2353,6 +2353,7 @@ void SpectateCopy(entity spectatee) {
        self.impulse = 0;
        self.items = spectatee.items;
        self.last_pickup = spectatee.last_pickup;
+       self.hit_time = spectatee.hit_time;
        self.metertime = spectatee.metertime;
        self.strength_finished = spectatee.strength_finished;
        self.invincible_finished = spectatee.invincible_finished;
index 4a73ee9f48e0053b37c44c3601214441eb6991a8..df80e703b7fe14dbd73c5f0c3148e34ff9a29d23 100644 (file)
@@ -605,6 +605,9 @@ string matchid;
 
 .float last_pickup;
 
+.float hit_time; 
+.float typehit_time; 
+
 .float stat_leadlimit;
 
 float radar_showennemies;
index 68be349714138d5f6f865ac5d53494fd820fc1b1..22497c99d978eb9ba4cc74511d5d6c96cc793b7b 100644 (file)
@@ -790,13 +790,11 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                        if(damage > 0)
                                        {
                                                if(deathtype != DEATH_FIRE)
-                                               if(attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
                                                {
                                                        if(targ.BUTTON_CHAT)
                                                                attacker.typehitsound += 1;
                                                        else
                                                                attacker.hitsound += 1;
-                                                       attacker.prevhitsound = time;
                                                }
 
                                                damage_goodhits += 1;
@@ -822,10 +820,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                else
                                {
                                        if(deathtype != DEATH_FIRE)
-                                       if(attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
                                        {
                                                attacker.typehitsound += 1;
-                                               attacker.prevhitsound = time;
                                        }
                                        if(mirrordamage > 0)
                                                if(time > attacker.teamkill_complain)
index e177cdec73673d89bf4c812aff5dfaad099c8da6..6c0921ba9b6ee7317f341dd2e09a623786a3c4d7 100644 (file)
@@ -1722,6 +1722,7 @@ void follow_init()
                        attach_sameorigin(dst, src, self.message);
                }
 
+               dst.solid = SOLID_NOT; // solid doesn't work with attachment
                remove(self);
        }
        else
index ffbc58e32004f50933075a02aa9a2ea0cf9247ba..57d0071d2f063d78c0a5a9031f7b087ca795ac8f 100644 (file)
@@ -826,6 +826,8 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);
        addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size);
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
+       addstat(STAT_HIT_TIME, AS_FLOAT, hit_time);
+       addstat(STAT_TYPEHIT_TIME, AS_FLOAT, typehit_time);
 
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
        addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);
@@ -2841,16 +2843,16 @@ void EndFrame()
                if(self.classname == "spectator")
                {
                        if(self.enemy.typehitsound)
-                               play2(self, "misc/typehit.wav");
+                               self.typehit_time = time;
                        else if(self.enemy.hitsound && self.cvar_cl_hitsound)
-                               play2(self, "misc/hit.wav");
+                               self.hit_time = time;
                }
                else
                {
                        if(self.typehitsound)
-                               play2(self, "misc/typehit.wav");
+                               self.typehit_time = time;
                        else if(self.hitsound && self.cvar_cl_hitsound)
-                               play2(self, "misc/hit.wav");
+                               self.hit_time = time;
                }
        }
        altime = time + frametime * (1 + autocvar_g_antilag_nudge);
index 508957b4aa4c6b14edb98c49d50f48216afc4dcd..c04c477cdf778cc0b32be50b5e628999342ad3f4 100644 (file)
@@ -1639,8 +1639,6 @@ void precache()
     precache_sound ("misc/gib_splat02.wav");
     precache_sound ("misc/gib_splat03.wav");
     precache_sound ("misc/gib_splat04.wav");
-    precache_sound ("misc/hit.wav");
-       precache_sound ("misc/typehit.wav");
     PrecacheGlobalSound((globalsound_fall = "misc/hitground 4"));
     PrecacheGlobalSound((globalsound_metalfall = "misc/metalhitground 4"));
     precache_sound ("misc/null.wav");
index b1f59497abde896bff38abc3fcfbad79120252ad..13e8eea40a9103424f89eb187af775d0903f247f 100644 (file)
@@ -725,6 +725,7 @@ float w_nexball_weapon(float req)
                precache_model ("models/elaser.mdl");
                precache_sound ("nexball/shoot1.wav");
                precache_sound ("nexball/shoot2.wav");
+               precache_sound ("misc/typehit.wav");
        }
        else if (req == WR_SETUP)
                weapon_setup(WEP_PORTO);
index f3afdf580c26b0ff2890ff28107c6c77ab1db964..f90c812d9bd0691ed332e4817bc2dd216c6338aa 100644 (file)
@@ -245,37 +245,43 @@ void spawnfunc_func_plat()
 void() train_next;
 void train_wait()
 {
-       self.think = train_next;
-       self.nextthink = self.ltime + self.wait;
-
        if(self.noise != "")
                stopsoundto(MSG_BROADCAST, self, CHAN_TRIGGER); // send this as unreliable only, as the train will resume operation shortly anyway
+
+       if(self.wait < 0)
+       {
+               train_next();
+       }
+       else
+       {
+               self.think = train_next;
+               self.nextthink = self.ltime + self.wait;
+       }
+
+       entity oldself;
+       oldself = self;
+       self = self.enemy;
+       SUB_UseTargets();
+       self = oldself;
+       self.enemy = world;
 };
 
 void train_next()
 {
        local entity targ;
        targ = find(world, targetname, self.target);
+       self.enemy = targ;
        self.target = targ.target;
        if (!self.target)
                objerror("train_next: no next target");
        self.wait = targ.wait;
        if (!self.wait)
                self.wait = 0.1;
-       if(self.wait < 0)
-       {
-               if (targ.speed)
-                       SUB_CalcMove(targ.origin - self.mins, targ.speed, train_next);
-               else
-                       SUB_CalcMove(targ.origin - self.mins, self.speed, train_next);
-       }
+
+       if (targ.speed)
+               SUB_CalcMove(targ.origin - self.mins, targ.speed, train_wait);
        else
-       {
-               if (targ.speed)
-                       SUB_CalcMove(targ.origin - self.mins, targ.speed, train_wait);
-               else
-                       SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
-       }
+               SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
 
        if(self.noise != "")
                sound(self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE);