From c243557b856c812307852bba8c866b74c9d67b74 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 7 Aug 2011 17:26:55 +0200 Subject: [PATCH] better waypoint auditing --- qcsrc/server/bot/waypoints.qc | 10 +++++++--- qcsrc/server/cl_impulse.qc | 26 +++++++++++++++----------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index 3bfb53264..29a6b86ad 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -772,13 +772,12 @@ void waypoint_spawnforitem(entity e) waypoint_spawnforitem_force(e, e.origin); }; -void waypoint_spawnforteleporter(entity e, vector destination, float timetaken) +void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken) { local entity w; local entity dw; - vector org; - org = (e.absmin + e.absmax) * 0.5; org = waypoint_fixorigin(org); + destination = waypoint_fixorigin(destination); w = waypoint_spawn(org, org, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK); dw = waypoint_spawn(destination, destination, WAYPOINTFLAG_GENERATED); // one way link to the destination @@ -790,6 +789,11 @@ void waypoint_spawnforteleporter(entity e, vector destination, float timetaken) e.nearestwaypointtimeout = time + 1000000000; }; +void waypoint_spawnforteleporter(entity e, vector destination, float timetaken) +{ + waypoint_spawnforteleporter_v(e, (e.absmin + e.absmax) * 0.5, destination, timetaken); +}; + entity waypoint_spawnpersonal(vector position) { entity w; diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index 3ae62bc56..939b6d258 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -259,8 +259,8 @@ void ImpulseCommands (void) case 107: for(e = findchain(classname, "waypoint"); e; e = e.chain) { - e.colormod_x = 1; - e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE | EF_BRIGHTLIGHT; + e.colormod = '0.5 0.5 0.5'; + e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE; } e2 = navigation_findnearestwaypoint(self, FALSE); navigation_markroutes(e2); @@ -271,8 +271,8 @@ void ImpulseCommands (void) if(e.wpcost >= 10000000) { print("unreachable: ", etos(e), " ", vtos(e.origin), "\n"); - e.colormod_x = 0.1; - e.effects |= EF_NODEPTHTEST | EF_BLUE | EF_BRIGHTLIGHT; + e.colormod_z = 8; + e.effects |= EF_NODEPTHTEST | EF_BLUE; ++i; ++m; } @@ -286,10 +286,10 @@ void ImpulseCommands (void) if(e.wpcost >= 10000000) { print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n"); - e.colormod_x = 0.1; + e.colormod_x = 8; if not(e.effects & EF_NODEPTHTEST) // not already reported before ++m; - e.effects |= EF_NODEPTHTEST | EF_RED | EF_BRIGHTLIGHT; + e.effects |= EF_NODEPTHTEST | EF_RED; ++i; } } @@ -306,17 +306,18 @@ void ImpulseCommands (void) if(navigation_findnearestwaypoint(e, FALSE)) { setorigin(e, org); - e.effects &~= EF_NODEPTHTEST | EF_BRIGHTLIGHT; + e.effects &~= EF_NODEPTHTEST; e.model = ""; } else { setorigin(e, org); print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n"); - e.effects |= EF_NODEPTHTEST | EF_BRIGHTLIGHT; + e.effects |= EF_NODEPTHTEST; setmodel(e, self.model); e.frame = self.frame; e.skin = self.skin; + e.colormod = '8 0.5 8'; setsize(e, '0 0 0', '0 0 0'); ++i; } @@ -328,7 +329,8 @@ void ImpulseCommands (void) start = findchainflags(flags, FL_ITEM); for(e = start; e; e = e.chain) { - e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE | EF_BRIGHTLIGHT; + e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE; + e.colormod = '0.5 0.5 0.5'; } for(e = start; e; e = e.chain) { @@ -338,7 +340,8 @@ void ImpulseCommands (void) else { print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n"); - e.effects |= EF_NODEPTHTEST | EF_RED | EF_BRIGHTLIGHT; + e.effects |= EF_NODEPTHTEST | EF_RED; + e.colormod_x = 8; ++i; } } @@ -354,7 +357,8 @@ void ImpulseCommands (void) else { print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n"); - e.effects |= EF_NODEPTHTEST | EF_BLUE | EF_BRIGHTLIGHT; + e.effects |= EF_NODEPTHTEST | EF_BLUE; + e.colormod_z = 8; ++i; } } -- 2.39.2