]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mand1nga/pathfinding-optimizations
authormand1nga <mand1nga@xonotic.org>
Mon, 15 Aug 2011 04:56:12 +0000 (01:56 -0300)
committermand1nga <mand1nga@xonotic.org>
Mon, 15 Aug 2011 04:56:12 +0000 (01:56 -0300)
20 files changed:
_hud_descriptions.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_old.cfg
hud_luminos_xhair_minimal.cfg
hud_nexuiz.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/menu/xonotic/dialog_hudpanel_physics.c
qcsrc/server/bot/bot.qc
qcsrc/server/bot/bot.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/navigation.qh
qcsrc/server/bot/waypoints.qc
qcsrc/server/cl_client.qc
qcsrc/server/domination.qc
qcsrc/server/mode_onslaught.qc
xonotic-credits.txt

index e4c669663324bca895414a5e8e954451199aaa02..3064fcfd1816caa7beeeb3cb02eb76aedae9746f 100644 (file)
@@ -220,7 +220,7 @@ seta hud_panel_infomessages_bg_border "" "if set to something else than \"\" = o
 seta hud_panel_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_infomessages_flip "" "1 = align the items to the right"
 
-seta hud_panel_physics "" "enable/disable this panel, 1 = show if not observing, 2 = show always"
+seta hud_panel_physics "" "enable/disable this panel, 1 = show if not observing, 2 = show always, 3 = show only in race/cts if not observing"
 seta hud_panel_physics_pos "" "position of this base of the panel"
 seta hud_panel_physics_size "" "size of this panel"
 seta hud_panel_physics_bg "" "if set to something else than \"\" = override default background"
index 4c11d42079856dee560dc26463a74c9e2001df10..5631ef4d66f88ac6120d9a8ddfaa5f7408cfb1ba 100644 (file)
@@ -218,7 +218,7 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics 0
+seta hud_panel_physics 3
 seta hud_panel_physics_pos "0.420000 0.620000"
 seta hud_panel_physics_size "0.170000 0.080000"
 seta hud_panel_physics_bg ""
index 5d803304475b0b1a78ee8416ef6a2c62bff8db55..ed90507ade5471ac5593bfd9347c41a79ba061e7 100644 (file)
@@ -218,7 +218,7 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics 0
+seta hud_panel_physics 3
 seta hud_panel_physics_pos "0.440000 0.590000"
 seta hud_panel_physics_size "0.120000 0.050000"
 seta hud_panel_physics_bg ""
index a5e16e75a4acb7430e89a8c3e67bf1e07980ce77..97457a1c79b48da07c0859b1f2a78aa7e3d99b82 100644 (file)
@@ -218,7 +218,7 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics 0
+seta hud_panel_physics 3
 seta hud_panel_physics_pos "0.410000 0.590000"
 seta hud_panel_physics_size "0.180000 0.100000"
 seta hud_panel_physics_bg ""
index 55a1149e9226adbe2140ddaae253cf51cdd4fcba..08791198860c4002360267254d812a7842b70d7e 100644 (file)
@@ -218,7 +218,7 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics 0
+seta hud_panel_physics 3
 seta hud_panel_physics_pos "0.270000 0.730000"
 seta hud_panel_physics_size "0.170000 0.030000"
 seta hud_panel_physics_bg ""
index 87bebc5d035fd5e49d33a74a149e23ffcce4bbc3..d7a777aef5fde4e69be9a4a4160ca1c48028c612 100644 (file)
@@ -218,7 +218,7 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding ""
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics 0
+seta hud_panel_physics 3
 seta hud_panel_physics_pos "0.430000 0.640000"
 seta hud_panel_physics_size "0.140000 0.100000"
 seta hud_panel_physics_bg "0"
index e6dc7309832da9e182e0661d6dc0c9d4d898adb3..97ed6df284809647fa59e019753068024a355553 100644 (file)
@@ -132,10 +132,13 @@ vector GetCurrentFov(float fov)
        if(spectatee_status > 0 || isdemo())
        {
                if(spectatorbutton_zoom)
-                       zoomdir = 0 + !zoomdir;
-               // do not even THINK about removing this 0
-               // _I_ know what I am doing
-               // fteqcc does not
+               {
+                       if(zoomdir)
+                               zoomdir = 0;
+                       else
+                               zoomdir = 1;
+               }
+               // fteqcc failed twice here already, don't optimize this
        }
 
        if(zoomdir)
@@ -381,6 +384,13 @@ void CSQC_UpdateView(float w, float h)
        button_attack2 = (input_buttons & BUTTON_3);
        button_zoom = (input_buttons & BUTTON_4);
 
+       // FIXME do we need this hack?
+       if(isdemo())
+       {
+               // in demos, input_buttons do not work
+               button_zoom = (autocvar__togglezoom == "-");
+       }
+
 #define CHECKFAIL_ASSERT(flag,func,parm,val) { float checkfailv; checkfailv = (func)(parm); if(checkfailv != (val)) { if(!checkfail[(flag)]) localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); checkfail[(flag)] = 1; } } ENDS_WITH_CURLY_BRACE
        CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0);
        CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0);
index 0dc5b184980199a00517856f160b89492f01c217..f78691ef12a50206070bfde9194de22212721564 100644 (file)
@@ -349,3 +349,4 @@ var float autocvar_cl_eventchase_death = 1;
 var float autocvar_cl_eventchase_distance = 140;
 var float autocvar_cl_eventchase_speed = 1.3;
 float autocvar_cl_lerpexcess;
+string autocvar__togglezoom;
index 260b2c5c5993925456fecda0cbc9c1ca770cdf5b..3493edbf9608acd8b0d8651b2f9c62c2b41a03d4 100644 (file)
@@ -4290,7 +4290,8 @@ void HUD_Physics(void)
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_physics) return;
-               if(spectatee_status == -1 && autocvar_hud_panel_physics < 2) return;
+               if(spectatee_status == -1 && (autocvar_hud_panel_physics == 1 || autocvar_hud_panel_physics == 3)) return;
+               if(autocvar_hud_panel_physics == 3 && !(gametype == GAME_RACE || gametype == GAME_CTS)) return;
        }
        else
                hud_configure_active_panel = HUD_PANEL_PHYSICS;
index f8b162f2396e398f2ce0f2b82a0d48f7eaabf990..aeedc492df6dea50d26b1ada2f553baad827e8ba 100644 (file)
@@ -20,8 +20,9 @@ void XonoticHUDPhysicsDialog_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_physics"));
                        e.addValue(e, _("Panel disabled"), "0");
-                       e.addValue(e, _("Panel enabled if not observing"), "1");
-                       e.addValue(e, _("Panel always enabled"), "2");
+                       e.addValue(e, _("Panel enabled"), "1");
+                       e.addValue(e, _("Panel enabled even observing"), "2");
+                       e.addValue(e, _("Panel enabled only in Race/CTS"), "3");
                        e.configureXonoticTextSliderValues(e);
 
        DIALOG_HUDPANEL_COMMON_NOTOGGLE();
index 951d4adb67cc6e5ff8bfb93f372620b7be9b6ec5..351625bb555cef6c001bd02508161691158a9051 100644 (file)
@@ -529,6 +529,14 @@ void autoskill(float factor)
                head.totalfrags_lastcheck = head.totalfrags;
 }
 
+void bot_calculate_stepheightvec(void)
+{
+       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       jumpstepheightvec = stepheightvec +
+               ((autocvar_sv_jumpvelocity * autocvar_sv_jumpvelocity) / (2 * autocvar_sv_gravity)) * '0 0 0.85';
+               // 0.75 factor is for safety to make the jumps easy
+}
+
 void bot_serverframe()
 {
        float realplayers, bots, activerealplayers;
@@ -540,7 +548,7 @@ void bot_serverframe()
        if (time < 2)
                return;
 
-       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_calculate_stepheightvec();
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        if(time > autoskill_nextthink)
index 55f3250ee167294272ed9464c3d6657b23bcdda1..6823841d9bc91aa7d998369782b884d4721f2212 100644 (file)
@@ -114,3 +114,5 @@ void() havocbot_setupbot;
 float c1, c2, c3, c4;
 void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other);
 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);
+
+void bot_calculate_stepheightvec(void);
index 377dc2ef97237b60ccdc91ff06c4414f5da03f88..1d9054952d24bbdde4d63981bc5a86689f3a44f4 100644 (file)
@@ -714,12 +714,12 @@ void havocbot_movetogoal()
                        if (trace_plane_normal_z < 0.7)
                        {
                                s = trace_fraction;
-                               tracebox(self.origin + '0 0 16', self.mins, self.maxs, self.origin + self.velocity * 0.2 + '0 0 16', FALSE, self);
+                               tracebox(self.origin + stepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + stepheightvec, FALSE, self);
                                if (trace_fraction < s + 0.01)
                                if (trace_plane_normal_z < 0.7)
                                {
                                        s = trace_fraction;
-                                       tracebox(self.origin + '0 0 48', self.mins, self.maxs, self.origin + self.velocity * 0.2 + '0 0 48', FALSE, self);
+                                       tracebox(self.origin + jumpstepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + jumpstepheightvec, FALSE, self);
                                        if (trace_fraction > s)
                                                self.BUTTON_JUMP = 1;
                                }
index 2d66b021327e116231d567c989b2f77c7728d388..4f680284eec19ff96b3b6bcfbfa3477a04d9abd7 100644 (file)
@@ -133,8 +133,8 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float
                        // hit something
                        if (trace_fraction < 1)
                        {
-                               // check if we can walk over this obstacle
-                               tracebox(org + stepheightvec, m1, m2, move + stepheightvec, movemode, e);
+                               // check if we can walk over this obstacle, possibly by jumpstepping
+                               tracebox(org + jumpstepheightvec, m1, m2, move + jumpstepheightvec, movemode, e);
                                if (trace_fraction < 1 || trace_startsolid)
                                {
                                        if(autocvar_bot_debug_tracewalk)
index 8b227afd9397899ffe1d4d7d9029221276de6146..b3b40ce03e55443be1c82e8e362f354381e82483 100644 (file)
@@ -6,6 +6,7 @@ float navigation_bestrating;
 float bot_navigation_movemode;
 float navigation_testtracewalk;
 
+vector jumpstepheightvec;
 vector stepheightvec;
 
 entity botframe_dangerwaypoint;
index 2fe2a09d79a2d1d5bf2beb533e35ebead738fef8..8aea49be512d0b6f7dfd42e8b5d40f73585ef73f 100644 (file)
@@ -154,7 +154,8 @@ void waypoint_think()
        local entity e;
        local vector sv, sm1, sm2, ev, em1, em2, dv;
 
-       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_calculate_stepheightvec();
+
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        //dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");
index a4f937a33860cf5e2f97189218fd3ff8803e55a2..a497f8c34e336a4508296ebafb80e769ab401c52 100644 (file)
@@ -1277,10 +1277,10 @@ void ClientKill_Now()
             Damage(self, self, self, 1 , DEATH_KILL, self.origin, '0 0 0');            
            }
        }
-       
+
        if(self.killindicator && !wasfreed(self.killindicator))
-        remove(self.killindicator);
-       
+               remove(self.killindicator);
+
        self.killindicator = world;
 
        if(self.killindicator_teamchange)
@@ -1293,6 +1293,13 @@ void ClientKill_Now()
 }
 void KillIndicator_Think()
 {
+       if (gameover)
+       {
+               self.owner.killindicator = world;
+               remove(self);
+               return;
+       }
+
        if (!self.owner.modelindex)
        {
                self.owner.killindicator = world;
@@ -1340,6 +1347,10 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
 {
        float killtime;
        entity e;
+
+       if (gameover)
+               return;
+
        killtime = autocvar_g_balance_kill_delay;
 
        if(g_race_qualifying || g_cts)
@@ -1412,6 +1423,9 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
 
 void ClientKill (void)
 {
+       if (gameover)
+               return;
+
        if((g_arena || g_ca) && ((champion && champion.classname == "player" && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
        {
                // do nothing
@@ -1435,55 +1449,6 @@ void CTS_ClientKill (entity e) // silent version of ClientKill, used when player
     e.lip = 0;
 }
 
-void DoTeamChange(float destteam)
-{
-       float t, c0;
-       if(!teamplay)
-       {
-               if(destteam >= 0)
-                       SetPlayerColors(self, destteam);
-               return;
-       }
-       if(self.classname == "player")
-       if(destteam == -1)
-       {
-               CheckAllowedTeams(self);
-               t = FindSmallestTeam(self, TRUE);
-               switch(self.team)
-               {
-                       case COLOR_TEAM1: c0 = c1; break;
-                       case COLOR_TEAM2: c0 = c2; break;
-                       case COLOR_TEAM3: c0 = c3; break;
-                       case COLOR_TEAM4: c0 = c4; break;
-                       default:          c0 = 999;
-               }
-               switch(t)
-               {
-                       case 1:
-                               if(c0 > c1)
-                                       destteam = COLOR_TEAM1;
-                               break;
-                       case 2:
-                               if(c0 > c2)
-                                       destteam = COLOR_TEAM2;
-                               break;
-                       case 3:
-                               if(c0 > c3)
-                                       destteam = COLOR_TEAM3;
-                               break;
-                       case 4:
-                               if(c0 > c4)
-                                       destteam = COLOR_TEAM4;
-                               break;
-               }
-               if(destteam == -1)
-                       return;
-       }
-       if(destteam == self.team && destteam >= 0 && !self.killindicator)
-               return;
-       ClientKill_TeamChange(destteam);
-}
-
 void FixClientCvars(entity e)
 {
        // send prediction settings to the client
index cf0584b7283b6cea20f933597a4a156799f1cb5d..a4cee747131100efe733169aa349c65b46defcd5 100644 (file)
@@ -34,7 +34,6 @@ float pps_yellow;
 float pps_pink;
 void set_dom_state(entity e)
 {
-       // BIG ugly hack to make stat sending work
        e.dom_total_pps = total_pps;
        e.dom_pps_red = pps_red;
        e.dom_pps_blue = pps_blue;
@@ -130,50 +129,49 @@ void dompoint_captured ()
        self.delay = old_delay;
        self.team = old_team;
 
-       switch(self.team)
-       {
-               // "fix" pps when slightly under 0 because of approximation errors
-               case COLOR_TEAM1:
-                       pps_red -= (points/wait_time);
-                       if (pps_red < 0) pps_red = 0;
-                       break;
-               case COLOR_TEAM2:
-                       pps_blue -= (points/wait_time);
-                       if (pps_blue < 0) pps_blue = 0;
-                       break;
-               case COLOR_TEAM3:
-                       pps_yellow -= (points/wait_time);
-                       if (pps_yellow < 0) pps_yellow = 0;
-                       break;
-               case COLOR_TEAM4:
-                       pps_pink -= (points/wait_time);
-                       if (pps_pink < 0) pps_pink = 0;
-       }
-
        switch(self.goalentity.team)
        {
-               // "fix" pps when slightly over total_pps because of approximation errors
                case COLOR_TEAM1:
-                       pps_red += (points/wait_time);
-                       if (pps_red > total_pps) pps_red = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-red", "", "");
                        break;
                case COLOR_TEAM2:
-                       pps_blue += (points/wait_time);
-                       if (pps_blue > total_pps) pps_blue = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-blue", "", "");
                        break;
                case COLOR_TEAM3:
-                       pps_yellow += (points/wait_time);
-                       if (pps_yellow > total_pps) pps_yellow = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-yellow", "", "");
                        break;
                case COLOR_TEAM4:
-                       pps_pink += (points/wait_time);
-                       if (pps_pink > total_pps) pps_pink = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
        }
 
+       total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
+       for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
+       {
+               if (autocvar_g_domination_point_amt)
+                       points = autocvar_g_domination_point_amt;
+               else
+                       points = head.frags;
+               if (autocvar_g_domination_point_rate)
+                       wait_time = autocvar_g_domination_point_rate;
+               else
+                       wait_time = head.wait;
+               switch(head.goalentity.team)
+               {
+                       case COLOR_TEAM1:
+                               pps_red += points/wait_time;
+                               break;
+                       case COLOR_TEAM2:
+                               pps_blue += points/wait_time;
+                               break;
+                       case COLOR_TEAM3:
+                               pps_yellow += points/wait_time;
+                               break;
+                       case COLOR_TEAM4:
+                               pps_pink += points/wait_time;
+               }
+               total_pps += points/wait_time;
+       }
+
        WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
        WaypointSprite_Ping(self.sprite);
 
@@ -366,12 +364,12 @@ void dom_controlpoint_setup()
                self.wait = 5;
 
        float points, waittime;
-       if (autocvar_g_domination_point_rate)
-               points = autocvar_g_domination_point_rate;
+       if (autocvar_g_domination_point_amt)
+               points = autocvar_g_domination_point_amt;
        else
                points = self.frags;
-       if (autocvar_g_domination_point_amt)
-               waittime = autocvar_g_domination_point_amt;
+       if (autocvar_g_domination_point_rate)
+               waittime = autocvar_g_domination_point_rate;
        else
                waittime = self.wait;
 
index 48e958dba6213cfd5b974f0cac70d4f9cb6ab5b4..4f8aee2e76431f3cb36d5f438007c7037cdd6076 100644 (file)
@@ -372,6 +372,7 @@ float onslaught_controlpoint_attackable(entity cp, float t)
        return 0;
 }
 
+float overtime_msg_time;
 void onslaught_generator_think()
 {
        local float d;
@@ -379,9 +380,14 @@ void onslaught_generator_think()
        self.nextthink = ceil(time + 1);
        if (!gameover)
        {
-               if (autocvar_timelimit)
-               if (time > game_starttime + autocvar_timelimit * 60)
+               if (autocvar_timelimit && time > game_starttime + autocvar_timelimit * 60)
                {
+                       if (!overtime_msg_time)
+                       {
+                               FOR_EACH_PLAYER(e)
+                                       centerprint(e, "^3Now playing ^1OVERTIME^3!\n^3Generators start now to self-damaging.\n^3The more control points your team holds,\n^3the more damage the enemy generator gets.");
+                               overtime_msg_time = time;
+                       }
                        // self.max_health / 300 gives 5 minutes of overtime.
                        // control points reduce the overtime duration.
                        sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
@@ -397,6 +403,8 @@ void onslaught_generator_think()
                        d = d * self.max_health / 300;
                        Damage(self, self, self, d, DEATH_HURTTRIGGER, self.origin, '0 0 0');
                }
+               else if (overtime_msg_time)
+                       overtime_msg_time = 0;
        }
 };
 
index 462378e9b78065a0fa4594a7a9bf41dd8db2a9ed..50e1f5d5890a0f5a74e89e1f78475d6b922b0fea 100644 (file)
@@ -83,10 +83,11 @@ MirceaKitsune
 Lord Canistra
 Nikoli
 
-**Active Contributors
+**Other Active Contributors
 Ant "Antibody" Zucaro
 Antonio "terencehill" Piu
 Ben "MooKow" Banker
+blkrbt
 Calinou
 chooksta
 Cuinn "Cuinnton" Herrick
@@ -94,6 +95,7 @@ Kristian "morfar" Johansson
 kojn
 Maik "SavageX" Merten
 MrBougo
+Przemysław "atheros" Grzywacz
 Ruszkai "C.Brutail" Ákos
 Samual Lenks
 Severin "sev" Meyer
@@ -107,7 +109,6 @@ Amos "torus" Dudley
 Andreas "Black" Kirsch
 Attila "WW3" Houtkooper
 BigMac
-blkrbt
 Braden "meoblast001" Walters
 Brain Younds
 Chris "amethyst7" Matz
@@ -167,7 +168,6 @@ Spirit
 Steve Vermeulen
 Supajoe
 Tei
-terencehill
 Tomaz
 Ulrich Galbraith
 Vortex