mirror of
https://git.code.sf.net/p/quake/game-source
synced 2025-04-21 23:11:23 +00:00
don't bother with the NIL first entry
This commit is contained in:
parent
61f3d32eae
commit
ae00d10d15
1 changed files with 6 additions and 5 deletions
|
@ -56,7 +56,6 @@ Array waypoint_array;
|
|||
{
|
||||
if (!waypoint_array) {
|
||||
waypoint_array = [[Array alloc] init];
|
||||
[waypoint_array addItem:NIL];
|
||||
waypoint_queue = [[List alloc] init];
|
||||
waypoint_thinker = spawn ();
|
||||
waypoint_thinker.classname = "waypoint_thinker";
|
||||
|
@ -74,8 +73,8 @@ Array waypoint_array;
|
|||
{
|
||||
[self init];
|
||||
[waypoint_array addItem: self];
|
||||
|
||||
if ([waypoint_array count] == 2) {
|
||||
origin = org;
|
||||
if ([waypoint_array count] == 1) {
|
||||
local id obj = [Waypoint class];
|
||||
local IMP imp = [obj methodForSelector: @selector (fixWaypoints)];
|
||||
waypoint_thinker.think = (void ()) imp;
|
||||
|
@ -210,7 +209,9 @@ Waypoint Loading from file
|
|||
|
||||
+(Waypoint)waypointForNum:(integer)num
|
||||
{
|
||||
return [waypoint_array getItemAt:num];
|
||||
if (!num)
|
||||
return NIL;
|
||||
return [waypoint_array getItemAt:num - 1];
|
||||
}
|
||||
|
||||
-(void)fix
|
||||
|
@ -238,7 +239,7 @@ Waypoint Loading from file
|
|||
rad = rad * rad; // radius squared
|
||||
|
||||
count = [waypoint_array count];
|
||||
for (i = 1; i < count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
w = [waypoint_array getItemAt:i];
|
||||
dif = w.origin - org;
|
||||
dist = dif * dif; // dist squared, really
|
||||
|
|
Loading…
Reference in a new issue