mirror of
https://git.code.sf.net/p/quake/game-source
synced 2024-11-21 19:41:25 +00:00
Fix up waypoing queues.
Now that List is gone, have to use Array.
This commit is contained in:
parent
a7ff8332c5
commit
029ca87f8c
3 changed files with 6 additions and 7 deletions
|
@ -43,7 +43,6 @@ this notice in its entirety.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Array.h>
|
#include <Array.h>
|
||||||
#include <List.h>
|
|
||||||
|
|
||||||
#include "libfrikbot.h"
|
#include "libfrikbot.h"
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
|
|
|
@ -45,7 +45,6 @@ this notice in its entirety.
|
||||||
#include "libfrikbot.h"
|
#include "libfrikbot.h"
|
||||||
#include "Array.h"
|
#include "Array.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "List.h"
|
|
||||||
|
|
||||||
@static hashtab_t target_tab;
|
@static hashtab_t target_tab;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ this notice in its entirety.
|
||||||
|
|
||||||
#include "libfrikbot.h"
|
#include "libfrikbot.h"
|
||||||
#include "Array.h"
|
#include "Array.h"
|
||||||
#include "List.h"
|
|
||||||
#include "qfile.h"
|
#include "qfile.h"
|
||||||
#include "qfs.h"
|
#include "qfs.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
@ -52,13 +51,13 @@ this notice in its entirety.
|
||||||
|
|
||||||
Array *waypoint_array;
|
Array *waypoint_array;
|
||||||
@static entity waypoint_thinker;
|
@static entity waypoint_thinker;
|
||||||
@static List *waypoint_queue;
|
@static Array *waypoint_queue;
|
||||||
|
|
||||||
@static void () waypoint_init =
|
@static void () waypoint_init =
|
||||||
{
|
{
|
||||||
waypoint_array = [[Array alloc] init];
|
waypoint_array = [[Array alloc] init];
|
||||||
if (!waypoint_queue)
|
if (!waypoint_queue)
|
||||||
waypoint_queue = [[List alloc] init];
|
waypoint_queue = [[Array alloc] init];
|
||||||
if (!waypoint_thinker) {
|
if (!waypoint_thinker) {
|
||||||
waypoint_thinker = spawn ();
|
waypoint_thinker = spawn ();
|
||||||
waypoint_thinker.classname = "waypoint_thinker";
|
waypoint_thinker.classname = "waypoint_thinker";
|
||||||
|
@ -552,18 +551,20 @@ tripping the runaway loop counter
|
||||||
direct_route = FALSE;
|
direct_route = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((waypoint_thinker.@this = [waypoint_queue removeItemAtHead])) {
|
if ([waypoint_queue count]
|
||||||
|
&& (waypoint_thinker.@this = [waypoint_queue lastObject])) {
|
||||||
local id obj = waypoint_thinker.@this;
|
local id obj = waypoint_thinker.@this;
|
||||||
local IMP imp = [obj methodForSelector: @selector (waypointThink)];
|
local IMP imp = [obj methodForSelector: @selector (waypointThink)];
|
||||||
waypoint_thinker.think = (void ()()) imp;
|
waypoint_thinker.think = (void ()()) imp;
|
||||||
waypoint_thinker.nextthink = time;
|
waypoint_thinker.nextthink = time;
|
||||||
|
[waypoint_queue removeLastObject];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(id)queueForThink
|
-(id)queueForThink
|
||||||
{
|
{
|
||||||
if (waypoint_thinker.@this) {
|
if (waypoint_thinker.@this) {
|
||||||
[waypoint_queue addItemAtTail: self];
|
[waypoint_queue addObject: self];
|
||||||
} else {
|
} else {
|
||||||
local IMP imp = [self methodForSelector: @selector (waypointThink)];
|
local IMP imp = [self methodForSelector: @selector (waypointThink)];
|
||||||
waypoint_thinker.think = (void ()()) imp;
|
waypoint_thinker.think = (void ()()) imp;
|
||||||
|
|
Loading…
Reference in a new issue