@@ -120,9 +120,6 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
120
120
else
121
121
AI .proneState = AHuman .NOTPRONE ;
122
122
end
123
-
124
- local _ai , _ownr , _abrt = coroutine.yield (); -- wait until next frame
125
- if _abrt then return true end
126
123
else
127
124
AI .proneState = AHuman .NOTPRONE ;
128
125
end
@@ -245,8 +242,6 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
245
242
UpdatePathTimer :Reset ();
246
243
AI .lateralMoveState = Actor .LAT_STILL ;
247
244
AI .jump = false ;
248
- local _ai , _ownr , _abrt = coroutine.yield (); -- wait until next frame
249
- if _abrt then return true end
250
245
251
246
if Owner .MOMoveTarget and MovableMan :ValidMO (Owner .MOMoveTarget ) then
252
247
Trace = SceneMan :ShortestDistance (Owner .Pos , Owner .MOMoveTarget .Pos , false );
@@ -306,15 +301,9 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
306
301
local centerAngle = CurrDist .AbsRadAngle ;
307
302
local Ray = Vector (Owner .Height * 0.3 , 0 ):RadRotate (centerAngle ); -- center
308
303
if SceneMan :CastNotMaterialRay (Owner .Pos , Ray , 0 , 3 , false ) < 0 then
309
- local _ai , _ownr , _abrt = coroutine.yield (); -- wait until next frame
310
- if _abrt then return true end
311
-
312
304
-- now check the tunnel's thickness
313
305
Ray = Vector (Owner .Height * 0.3 , 0 ):RadRotate (centerAngle + sweepRange ); -- up
314
306
if SceneMan :CastNotMaterialRay (Owner .Pos , Ray , rte .airID , 3 , false ) < 0 then
315
- local _ai , _ownr , _abrt = coroutine.yield (); -- wait until next frame
316
- if _abrt then return true end
317
-
318
307
Ray = Vector (Owner .Height * 0.3 , 0 ):RadRotate (centerAngle - sweepRange ); -- down
319
308
if SceneMan :CastNotMaterialRay (Owner .Pos , Ray , rte .airID , 3 , false ) < 0 then
320
309
obstacleState = Actor .PROCEEDING ; -- ok the tunnel section is clear, so start walking forward while still digging
@@ -326,9 +315,6 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
326
315
obstacleState = Actor .DIGPAUSING ; -- tunnel cavity not clear yet, so stay put and dig some more
327
316
end
328
317
329
- local _ai , _ownr , _abrt = coroutine.yield (); -- wait until next frame
330
- if _abrt then return true end
331
-
332
318
local aimAngle = Owner :GetAimAngle (true );
333
319
local AimVec = Vector (1 , 0 ):RadRotate (aimAngle );
334
320
@@ -355,28 +341,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
355
341
end
356
342
357
343
-- check if we are done when we get close enough to the waypoint
358
- if SceneMan :ShortestDistance (Owner .Pos , Waypoint .Pos , false ).Largest < Owner .Height * 0.3 then
359
- if not SceneMan :CastStrengthRay (PrevWptPos , SceneMan :ShortestDistance (PrevWptPos , Waypoint .Pos , false ), 5 , Vector (), 1 , rte .doorID , true ) and
360
- not SceneMan :CastStrengthRay (Owner .EyePos , SceneMan :ShortestDistance (Owner .EyePos , Waypoint .Pos , false ), 5 , Vector (), 1 , rte .doorID , true )
361
- then
362
- -- advance to the next waypoint, if there are any
363
- if Owner .MovePathSize > 0 then
364
- UpdatePathTimer :Reset ();
365
- PrevWptPos = Waypoint .Pos ;
366
- Owner :RemoveMovePathBeginning ();
367
-
368
- if Owner .MovePathSize > 0 then
369
- Waypoint .Pos = Owner .MovePath [1 ];
370
- Waypoint .Type = nil ;
371
- if Owner .MovePathSize == 1 then
372
- Waypoint .Type = " last" ;
373
- end
374
- end
375
- else
376
- Waypoint = nil ;
377
- end
378
- end
379
- elseif Owner .AIMode == Actor .AIMODE_GOLDDIG then
344
+ if Owner .AIMode == Actor .AIMODE_GOLDDIG then
380
345
Waypoint .Pos = SceneMan :MovePointToGround (Waypoint .Pos , Owner .Height * 0.2 , 4 );
381
346
end
382
347
end
0 commit comments