]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/navigation.qc
s/world/NULL/
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / navigation.qc
index 6eb872bb16fd91887f70b7149a0bd6c869423113..8deefdb39716c527be0bc1e36512cccfb07471cf 100644 (file)
@@ -229,38 +229,38 @@ void navigation_clearroute(entity this)
 {
        //print("bot ", etos(this), " clear\n");
        this.navigation_hasgoals = false;
-       this.goalcurrent = world;
-       this.goalstack01 = world;
-       this.goalstack02 = world;
-       this.goalstack03 = world;
-       this.goalstack04 = world;
-       this.goalstack05 = world;
-       this.goalstack06 = world;
-       this.goalstack07 = world;
-       this.goalstack08 = world;
-       this.goalstack09 = world;
-       this.goalstack10 = world;
-       this.goalstack11 = world;
-       this.goalstack12 = world;
-       this.goalstack13 = world;
-       this.goalstack14 = world;
-       this.goalstack15 = world;
-       this.goalstack16 = world;
-       this.goalstack17 = world;
-       this.goalstack18 = world;
-       this.goalstack19 = world;
-       this.goalstack20 = world;
-       this.goalstack21 = world;
-       this.goalstack22 = world;
-       this.goalstack23 = world;
-       this.goalstack24 = world;
-       this.goalstack25 = world;
-       this.goalstack26 = world;
-       this.goalstack27 = world;
-       this.goalstack28 = world;
-       this.goalstack29 = world;
-       this.goalstack30 = world;
-       this.goalstack31 = world;
+       this.goalcurrent = NULL;
+       this.goalstack01 = NULL;
+       this.goalstack02 = NULL;
+       this.goalstack03 = NULL;
+       this.goalstack04 = NULL;
+       this.goalstack05 = NULL;
+       this.goalstack06 = NULL;
+       this.goalstack07 = NULL;
+       this.goalstack08 = NULL;
+       this.goalstack09 = NULL;
+       this.goalstack10 = NULL;
+       this.goalstack11 = NULL;
+       this.goalstack12 = NULL;
+       this.goalstack13 = NULL;
+       this.goalstack14 = NULL;
+       this.goalstack15 = NULL;
+       this.goalstack16 = NULL;
+       this.goalstack17 = NULL;
+       this.goalstack18 = NULL;
+       this.goalstack19 = NULL;
+       this.goalstack20 = NULL;
+       this.goalstack21 = NULL;
+       this.goalstack22 = NULL;
+       this.goalstack23 = NULL;
+       this.goalstack24 = NULL;
+       this.goalstack25 = NULL;
+       this.goalstack26 = NULL;
+       this.goalstack27 = NULL;
+       this.goalstack28 = NULL;
+       this.goalstack29 = NULL;
+       this.goalstack30 = NULL;
+       this.goalstack31 = NULL;
 }
 
 // add a new goal at the beginning of the stack
@@ -343,7 +343,7 @@ void navigation_poproute(entity this)
        this.goalstack28 = this.goalstack29;
        this.goalstack29 = this.goalstack30;
        this.goalstack30 = this.goalstack31;
-       this.goalstack31 = world;
+       this.goalstack31 = NULL;
 }
 
 float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist)
@@ -399,7 +399,7 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom
        if (navigation_testtracewalk)
                te_plasmaburn(org);
 
-       best = world;
+       best = NULL;
 
        // box check failed, try walk
        w = waylist;
@@ -431,7 +431,7 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom
 }
 entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
 {
-       entity wp = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, world);
+       entity wp = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, NULL);
        if (autocvar_g_waypointeditor_auto)
        {
                entity wp2 = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, wp);
@@ -475,7 +475,7 @@ float navigation_markroutes_nearestwaypoints(entity this, entity waylist, float
                                        head.wpnearestpoint = v;
                                        head.wpcost = vlen(v - this.origin) + head.dmg;
                                        head.wpfire = 1;
-                                       head.enemy = world;
+                                       head.enemy = NULL;
                                        c = c + 1;
                                }
                        }
@@ -525,7 +525,7 @@ void navigation_markroutes(entity this, entity fixed_source_waypoint)
                w.wpnearestpoint = '0 0 0';
                w.wpcost = 10000000;
                w.wpfire = 0;
-               w.enemy = world;
+               w.enemy = NULL;
                w = w.chain;
        }
 
@@ -535,7 +535,7 @@ void navigation_markroutes(entity this, entity fixed_source_waypoint)
                fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
                fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg;
                fixed_source_waypoint.wpfire = 1;
-               fixed_source_waypoint.enemy = world;
+               fixed_source_waypoint.enemy = NULL;
        }
        else
        {
@@ -621,7 +621,7 @@ void navigation_markroutes_inverted(entity fixed_source_waypoint)
                w.wpnearestpoint = '0 0 0';
                w.wpcost = 10000000;
                w.wpfire = 0;
-               w.enemy = world;
+               w.enemy = NULL;
                w = w.chain;
        }
 
@@ -631,7 +631,7 @@ void navigation_markroutes_inverted(entity fixed_source_waypoint)
                fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
                fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; // the cost to get from X to fixed_source_waypoint
                fixed_source_waypoint.wpfire = 1;
-               fixed_source_waypoint.enemy = world;
+               fixed_source_waypoint.enemy = NULL;
        }
        else
        {
@@ -882,7 +882,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition)
        else
                e = e.enemy; // we already have added it, so...
 
-       if(e == world)
+       if(e == NULL)
                return false;
 
        for (;;)
@@ -891,7 +891,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition)
                navigation_pushroute(this, e);
                e = e.enemy;
 
-               if(e==world)
+               if(e==NULL)
                        break;
        }
 
@@ -955,7 +955,7 @@ void navigation_poptouchedgoals(entity this)
        {
                if(vdist(this.origin - this.goalcurrent.origin, <, 150))
                {
-                       traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, world);
+                       traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, NULL);
                        if(trace_fraction==1)
                        {
                                // Detect personal waypoints
@@ -991,12 +991,12 @@ void navigation_goalrating_start(entity this)
        if(this.aistatus & AI_STATUS_STUCK)
                return;
 
-       this.navigation_jetpack_goal = world;
+       this.navigation_jetpack_goal = NULL;
        navigation_bestrating = -1;
        this.navigation_hasgoals = false;
        navigation_clearroute(this);
-       navigation_bestgoal = world;
-       navigation_markroutes(this, world);
+       navigation_bestgoal = NULL;
+       navigation_markroutes(this, NULL);
 }
 
 // ends a goal selection session (updates goal stack to the best goal)
@@ -1030,7 +1030,7 @@ void botframe_updatedangerousobjects(float maxupdate)
        c = 0;
        bot_dodgelist = findchainfloat(bot_dodge, true);
        botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
-       while (botframe_dangerwaypoint != world)
+       while (botframe_dangerwaypoint != NULL)
        {
                danger = 0;
                m1 = botframe_dangerwaypoint.mins;
@@ -1046,7 +1046,7 @@ void botframe_updatedangerousobjects(float maxupdate)
                        d = head.bot_dodgerating - vlen(o - v);
                        if (d > 0)
                        {
-                               traceline(o, v, true, world);
+                               traceline(o, v, true, NULL);
                                if (trace_fraction == 1)
                                        danger = danger + d;
                        }
@@ -1071,7 +1071,7 @@ void navigation_unstuck(entity this)
        {
                LOG_DEBUG(strcat(this.netname, " sutck, taking over the waypoints queue\n"));
                bot_waypoint_queue_owner = this;
-               bot_waypoint_queue_bestgoal = world;
+               bot_waypoint_queue_bestgoal = NULL;
                bot_waypoint_queue_bestgoalrating = 0;
        }
 
@@ -1107,7 +1107,7 @@ void navigation_unstuck(entity this)
                                LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n"));
                        }
 
-                       bot_waypoint_queue_owner = world;
+                       bot_waypoint_queue_owner = NULL;
                }
        }
        else
@@ -1120,7 +1120,7 @@ void navigation_unstuck(entity this)
 
                entity head, first;
 
-               first = world;
+               first = NULL;
                head = findradius(this.origin, search_radius);
 
                while(head)
@@ -1134,7 +1134,7 @@ void navigation_unstuck(entity this)
                                        first = head;
 
                                bot_waypoint_queue_goal = head;
-                               bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = world;
+                               bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = NULL;
                        }
 
                        head = head.chain;
@@ -1145,7 +1145,7 @@ void navigation_unstuck(entity this)
                else
                {
                        LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n"));
-                       bot_waypoint_queue_owner = world;
+                       bot_waypoint_queue_owner = NULL;
                }
        }
 }
@@ -1168,7 +1168,7 @@ void debugnode(entity this, vector node)
                return;
        }
 
-       te_lightning2(world, node, debuglastnode);
+       te_lightning2(NULL, node, debuglastnode);
        debuglastnode = node;
 }
 
@@ -1237,9 +1237,9 @@ void debuggoalstack(entity this)
        else if(this.goalcounter==29)goal=this.goalstack29;
        else if(this.goalcounter==30)goal=this.goalstack30;
        else if(this.goalcounter==31)goal=this.goalstack31;
-       else goal=world;
+       else goal=NULL;
 
-       if(goal==world)
+       if(goal==NULL)
        {
                this.goalcounter = 0;
                this.lastposition='0 0 0';
@@ -1253,7 +1253,7 @@ void debuggoalstack(entity this)
 
 
        go = ( goal.absmin + goal.absmax ) * 0.5;
-       te_lightning2(world, org, go);
+       te_lightning2(NULL, org, go);
        this.lastposition = go;
 
        this.goalcounter++;