]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/updatecommands
authorSamual <samual@xonotic.org>
Sun, 14 Aug 2011 18:28:09 +0000 (14:28 -0400)
committerSamual <samual@xonotic.org>
Sun, 14 Aug 2011 18:28:09 +0000 (14:28 -0400)
22 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/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/bot.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/roles.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 63e971b17da9c52cacc638e8ae6c3f006cff096f..699748fdae58401b0fe3d9002977e88ac17f7993 100644 (file)
@@ -7,7 +7,7 @@ entity ka_ball;
 float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore)
 {
        local float c, savesolid, shottime;
-       local vector dir, end, v;
+       local vector dir, end, v, o;
        if (shotspeed < 1)
                return FALSE; // could cause division by zero if calculated
        if (targ.solid < SOLID_BBOX) // SOLID_NOT and SOLID_TRIGGER
@@ -18,9 +18,10 @@ float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, f
        setsize(tracetossent, m1, m2);
        savesolid = targ.solid;
        targ.solid = SOLID_NOT;
-       shottime = ((vlen(targ.origin - org) / shotspeed) + shotdelay);
-       v = targ.velocity * shottime + targ.origin;
-       tracebox(targ.origin, targ.mins, targ.maxs, v, FALSE, targ);
+       o = (targ.absmin + targ.absmax) * 0.5;
+       shottime = ((vlen(o - org) / shotspeed) + shotdelay);
+       v = targ.velocity * shottime + o;
+       tracebox(o, targ.mins, targ.maxs, v, FALSE, targ);
        v = trace_endpos;
        end = v + (targ.mins + targ.maxs) * 0.5;
        if ((vlen(end - org) / shotspeed + 0.2) > maxtime)
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 7c2f986346677e73b2cefc533cf45651ebd18cf0..1d9054952d24bbdde4d63981bc5a86689f3a44f4 100644 (file)
@@ -120,7 +120,7 @@ void havocbot_ai()
 
                local vector now,v,next;//,heading;
                local float aimdistance,skillblend,distanceblend,blend;
-               next = now = self.goalcurrent.origin - (self.origin + self.view_ofs);
+               next = now = ( (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5) - (self.origin + self.view_ofs);
                aimdistance = vlen(now);
                //heading = self.velocity;
                //dprint(self.goalstack01.classname,etos(self.goalstack01),"\n");
@@ -128,7 +128,7 @@ void havocbot_ai()
                        self.goalstack01 != self && self.goalstack01 != world && self.aistatus & AI_STATUS_RUNNING == 0 &&
                        !(self.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
                )
-                       next = self.goalstack01.origin - (self.origin + self.view_ofs);
+                       next = ((self.goalstack01.absmin + self.goalstack01.absmax) * 0.5) - (self.origin + self.view_ofs);
 
                skillblend=bound(0,(skill+self.bot_moveskill-2.5)*0.5,1); //lower skill player can't preturn
                distanceblend=bound(0,aimdistance/autocvar_bot_ai_keyboard_distance,1);
@@ -254,6 +254,7 @@ void havocbot_bunnyhop(vector dir)
        local float bunnyhopdistance;
        local vector deviation;
        local float maxspeed;
+       vector gco, gno;
 
        if(autocvar_g_midair)
                return;
@@ -291,7 +292,8 @@ void havocbot_bunnyhop(vector dir)
                self.bot_timelastseengoal = 0;
        }
 
-       bunnyhopdistance = vlen(self.origin - self.goalcurrent.origin);
+       gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5;
+       bunnyhopdistance = vlen(self.origin - gco);
 
        // Run only to visible goals
        if(self.flags & FL_ONGROUND)
@@ -324,18 +326,19 @@ void havocbot_bunnyhop(vector dir)
                                        if(self.aistatus & AI_STATUS_ROAMING)
                                        if(self.goalcurrent.classname=="waypoint")
                                        if not(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL)
-                                       if(fabs(self.goalcurrent.origin_z - self.origin_z) < self.maxs_z - self.mins_z)
+                                       if(fabs(gco_z - self.origin_z) < self.maxs_z - self.mins_z)
                                        if(self.goalstack01!=world)
                                        {
-                                               deviation = vectoangles(self.goalstack01.origin - self.origin) - vectoangles(self.goalcurrent.origin - self.origin);
+                                               gno = (self.goalstack01.absmin + self.goalstack01.absmax) * 0.5;
+                                               deviation = vectoangles(gno - self.origin) - vectoangles(gco - self.origin);
                                                while (deviation_y < -180) deviation_y = deviation_y + 360;
                                                while (deviation_y > 180) deviation_y = deviation_y - 360;
 
                                                if(fabs(deviation_y) < 20)
-                                               if(bunnyhopdistance < vlen(self.origin - self.goalstack01.origin))
-                                               if(fabs(self.goalstack01.origin_z - self.goalcurrent.origin_z) < self.maxs_z - self.mins_z)
+                                               if(bunnyhopdistance < vlen(self.origin - gno))
+                                               if(fabs(gno_z - gco_z) < self.maxs_z - self.mins_z)
                                                {
-                                                       if(vlen(self.goalcurrent.origin - self.goalstack01.origin) > autocvar_bot_ai_bunnyhop_startdistance)
+                                                       if(vlen(gco - gno) > autocvar_bot_ai_bunnyhop_startdistance)
                                                        if(checkpvs(self.origin + self.view_ofs, self.goalstack01))
                                                        {
                                                                checkdistance = FALSE;
@@ -405,6 +408,7 @@ void havocbot_movetogoal()
        local vector evadelava;
        local float s;
        local float maxspeed;
+       local vector gco;
        //local float dist;
        local vector dodge;
        //if (self.goalentity)
@@ -443,7 +447,7 @@ void havocbot_movetogoal()
                        float db, v, d;
                        vector dxy;
 
-                       dxy = self.origin - self.goalcurrent.origin; dxy_z = 0;
+                       dxy = self.origin - ( ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5 ); dxy_z = 0;
                        d = vlen(dxy);
                        v = vlen(self.velocity -  self.velocity_z * '0 0 1');
                        db = (pow(v,2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
@@ -501,7 +505,7 @@ void havocbot_movetogoal()
                                        if(distance>1000)
                                                continue;
 
-                                       traceline(self.origin + self.view_ofs , head.origin, TRUE, world);
+                                       traceline(self.origin + self.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), TRUE, world);
 
                                        if(trace_fraction<1)
                                                continue;
@@ -571,7 +575,7 @@ void havocbot_movetogoal()
                        if(self.goalcurrent==world)
                                dir = v_forward;
                        else
-                               dir = normalize(self.goalcurrent.origin - self.origin);
+                               dir = normalize(( ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5 ) - self.origin);
 
                        local vector xyvelocity = self.velocity; xyvelocity_z = 0;
                        local float xyspeed = xyvelocity * dir;
@@ -656,6 +660,7 @@ void havocbot_movetogoal()
                return;
        }
 
+
        if(autocvar_bot_debug_goalstack)
                debuggoalstack();
 
@@ -670,6 +675,7 @@ void havocbot_movetogoal()
        dir = normalize(diff);
        flatdir = diff;flatdir_z = 0;
        flatdir = normalize(flatdir);
+       gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5;
 
        //if (self.bot_dodgevector_time < time)
        {
@@ -687,7 +693,7 @@ void havocbot_movetogoal()
                        }
                        else
                        {
-                               if(self.velocity_z >= 0 && !(self.watertype == CONTENT_WATER && self.goalcurrent.origin_z < self.origin_z) &&
+                               if(self.velocity_z >= 0 && !(self.watertype == CONTENT_WATER && gco_z < self.origin_z) &&
                                        ( !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER) || self.aistatus & AI_STATUS_OUT_WATER))
                                        self.BUTTON_JUMP = TRUE;
                                else
@@ -708,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;
                                }
@@ -783,7 +789,11 @@ void havocbot_movetogoal()
                                                {
                                                        // Remove dangerous dynamic goals from stack
                                                        if (self.goalcurrent.classname == "player" || self.goalcurrent.classname == "droppedweapon")
+                                                       {
                                                                navigation_poproute();
+                                                               if(self.goalcurrent)
+                                                                       gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5;
+                                                       }
                                                        // try to stop
                                                        flatdir = '0 0 0';
                                                        evadeobstacle = normalize(self.velocity) * -1;
@@ -804,7 +814,7 @@ void havocbot_movetogoal()
                dodge = havocbot_dodge();
                dodge = dodge * bound(0,0.5+(skill+self.bot_dodgeskill)*0.1,1);
                evadelava = evadelava * bound(1,3-(skill+self.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it
-               traceline(self.origin, self.enemy.origin, TRUE, world);
+               traceline(self.origin, ( ( self.enemy.absmin + self.enemy.absmax ) * 0.5 ), TRUE, world);
                if(trace_ent.classname == "player")
                        dir = dir * bound(0,(skill+self.bot_dodgeskill)/7,1);
 
@@ -874,9 +884,9 @@ void havocbot_chooseenemy()
                        // and not really really far away
                        // and we're not severely injured
                        // then keep tracking for a half second into the future
-                       traceline(self.origin+self.view_ofs, self.enemy.origin+self.enemy.view_ofs*0.5,FALSE,world);
+                       traceline(self.origin+self.view_ofs, ( self.enemy.absmin + self.enemy.absmax ) * 0.5,FALSE,world);
                        if (trace_ent == self.enemy || trace_fraction == 1)
-                       if (vlen(self.enemy.origin - self.origin) < 1000)
+                       if (vlen((( self.enemy.absmin + self.enemy.absmax ) * 0.5) - self.origin) < 1000)
                        if (self.health > 30)
                        {
                                // remain tracking him for a shot while (case he went after a small corner or pilar
@@ -1084,10 +1094,10 @@ void havocbot_aim()
                enemyvel = self.enemy.velocity;
                if (!self.enemy.waterlevel)
                        enemyvel_z = 0;
-               lag_additem(time + self.ping, 0, 0, self.enemy, self.origin, selfvel, self.enemy.origin, enemyvel);
+               lag_additem(time + self.ping, 0, 0, self.enemy, self.origin, selfvel, (self.enemy.absmin + self.enemy.absmax) * 0.5, enemyvel);
        }
        else
-               lag_additem(time + self.ping, 0, 0, world, self.origin, selfvel, self.goalcurrent.origin, '0 0 0');
+               lag_additem(time + self.ping, 0, 0, world, self.origin, selfvel, ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5, '0 0 0');
 };
 
 float havocbot_moveto_refresh_route()
@@ -1145,7 +1155,7 @@ float havocbot_moveto(vector pos)
                        debuggoalstack();
 
                // Heading
-               local vector dir = self.goalcurrent.origin - (self.origin + self.view_ofs);
+               local vector dir = ( ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5 ) - (self.origin + self.view_ofs);
                dir_z = 0;
                bot_aimdir(dir, -1);
 
index ac52c698f6cdb10c6387799898f9f400ebc5ef54..18699a7bd6f310001cc50e3ac359d250a55f6e5a 100644 (file)
@@ -10,12 +10,14 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
        local entity head;
        local entity player;
        local float rating, d, discard, distance, friend_distance, enemy_distance;
+       vector o;
        ratingscale = ratingscale * 0.0001; // items are rated around 10000 already
        head = findchainfloat(bot_pickup, TRUE);
 
        while (head)
        {
-               distance = vlen(head.origin - org);
+               o = (head.absmin + head.absmax) * 0.5;
+               distance = vlen(o - org);
                friend_distance = 10000; enemy_distance = 10000;
                rating = 0;
 
@@ -28,7 +30,7 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                // Check if the item can be picked up safely
                if(head.classname == "droppedweapon")
                {
-                       traceline(head.origin, head.origin + '0 0 -1500', TRUE, world);
+                       traceline(o, o + '0 0 -1500', TRUE, world);
 
                        d = pointcontents(trace_endpos + '0 0 1');
                        if(d & CONTENT_WATER || d & CONTENT_SLIME || d & CONTENT_LAVA)
@@ -63,7 +65,7 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                                if ( self == player || player.deadflag )
                                        continue;
 
-                               d = vlen(player.origin - head.origin); // distance between player and item
+                               d = vlen(player.origin - o); // distance between player and item
 
                                if ( player.team == self.team )
                                {
@@ -131,7 +133,7 @@ void havocbot_goalrating_controlpoints(float ratingscale, vector org, float srad
        head = findchain(classname, "dom_controlpoint");
        while (head)
        {
-               if (vlen(head.origin - org) < sradius)
+               if (vlen(( ( head.absmin + head.absmax ) * 0.5 ) - org) < sradius)
                {
                        if(head.cnt > -1) // this is just being fought for
                                navigation_routerating(head, ratingscale, 5000);
index 258d3d1770fe1c023991106bd15bb7bd063be40e..749b78fed6546eb7c9460dd88a00cfa2d43b07e3 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)
@@ -641,16 +641,18 @@ void navigation_markroutes_inverted(entity fixed_source_waypoint)
 void navigation_routerating(entity e, float f, float rangebias)
 {
        entity nwp;
+       vector o;
        if (!e)
                return;
 
+       o = (e.absmin + e.absmax) * 0.5;
        //print("routerating ", etos(e), " = ", ftos(f), " - ", ftos(rangebias), "\n");
 
        // Evaluate path using jetpack
        if(g_jetpack)
        if(self.items & IT_JETPACK)
        if(autocvar_bot_ai_navigation_jetpack)
-       if(vlen(self.origin - e.origin) > autocvar_bot_ai_navigation_jetpack_mindistance)
+       if(vlen(self.origin - o) > autocvar_bot_ai_navigation_jetpack_mindistance)
        {
                vector pointa, pointb;
 
@@ -661,7 +663,7 @@ void navigation_routerating(entity e, float f, float rangebias)
                pointa = trace_endpos - '0 0 1';
 
                // Point B
-               traceline(e.origin, e.origin + '0 0 65535', MOVE_NORMAL, e);
+               traceline(o, o + '0 0 65535', MOVE_NORMAL, e);
                pointb = trace_endpos - '0 0 1';
 
                // Can I see these two points from the sky?
@@ -768,7 +770,7 @@ void navigation_routerating(entity e, float f, float rangebias)
        {
                //te_wizspike(nwp.wpnearestpoint);
        //      dprint(e.classname, " ", ftos(f), "/(1+", ftos((nwp.wpcost + vlen(e.origin - nwp.wpnearestpoint))), "/", ftos(rangebias), ") = ");
-               f = f * rangebias / (rangebias + (nwp.wpcost + vlen(e.origin - nwp.wpnearestpoint)));
+               f = f * rangebias / (rangebias + (nwp.wpcost + vlen(o - nwp.wpnearestpoint)));
                //dprint("considering ", e.classname, " (with rating ", ftos(f), ")\n");
                //dprint(ftos(f));
                if (navigation_bestrating < f)
@@ -801,7 +803,7 @@ float navigation_routetogoal(entity e, vector startposition)
                return TRUE;
 
        // if it can reach the goal there is nothing more to do
-       if (tracewalk(self, startposition, PL_MIN, PL_MAX, e.origin, bot_navigation_movemode))
+       if (tracewalk(self, startposition, PL_MIN, PL_MAX, (e.absmin + e.absmax) * 0.5, bot_navigation_movemode))
                return TRUE;
 
        // see if there are waypoints describing a path to the item
@@ -927,7 +929,7 @@ void navigation_goalrating_end()
 void botframe_updatedangerousobjects(float maxupdate)
 {
        local entity head, bot_dodgelist;
-       local vector m1, m2, v;
+       local vector m1, m2, v, o;
        local float c, d, danger;
        c = 0;
        bot_dodgelist = findchainfloat(bot_dodge, TRUE);
@@ -944,10 +946,11 @@ void botframe_updatedangerousobjects(float maxupdate)
                        v_x = bound(m1_x, v_x, m2_x);
                        v_y = bound(m1_y, v_y, m2_y);
                        v_z = bound(m1_z, v_z, m2_z);
-                       d = head.bot_dodgerating - vlen(head.origin - v);
+                       o = (head.absmin + head.absmax) * 0.5;
+                       d = head.bot_dodgerating - vlen(o - v);
                        if (d > 0)
                        {
-                               traceline(head.origin, v, TRUE, world);
+                               traceline(o, v, TRUE, world);
                                if (trace_fraction == 1)
                                        danger = danger + d;
                        }
@@ -1104,7 +1107,7 @@ void debugnodestatus(vector position, float status)
 void debuggoalstack()
 {
        local entity goal;
-       local vector org;
+       local vector org, go;
 
        if(self.goalcounter==0)goal=self.goalcurrent;
        else if(self.goalcounter==1)goal=self.goalstack01;
@@ -1152,8 +1155,9 @@ void debuggoalstack()
                org = self.lastposition;
 
 
-       te_lightning2(world, org, goal.origin);
-       self.lastposition = goal.origin;
+       go = ( goal.absmin + goal.absmax ) * 0.5;
+       te_lightning2(world, org, go);
+       self.lastposition = go;
 
        self.goalcounter++;
 }
index 0a9bf14010d17176eab4a7740b9b997f2facd622..8971692de03193c546f0a33ac09eb65709038884 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