[Fix] Fixed ai's "dead spot".
This commit is contained in:
		
							parent
							
								
									e758e541f1
								
							
						
					
					
						commit
						812321b07d
					
				| @ -55,12 +55,9 @@ function atk_g() | ||||
|   if dist > range * atk_approach then | ||||
|     atk_g_ranged(target, dist) | ||||
| 
 | ||||
|   -- Now we do an approach. | ||||
|   elseif dist > range * atk_aim then | ||||
|     if ai.relvel(target) > -10 then | ||||
|       atk_g_ranged(target, dist) | ||||
|     else | ||||
|       atk_g_aim(target, dist) | ||||
|     end | ||||
|     atk_g_approach(target, dist) | ||||
| 
 | ||||
|   -- Close enough to melee. | ||||
|   else | ||||
| @ -98,10 +95,13 @@ function atk_g_ranged(target, dist) | ||||
| end | ||||
| 
 | ||||
| --[[ | ||||
| --    Aim at the target. | ||||
| --    Approaches the target. | ||||
| --]] | ||||
| function atk_g_aim(target, dist) | ||||
| function atk_g_approach(target, dist) | ||||
|   dir = ai.aim(target) | ||||
|   if dir < 10 then | ||||
|     ai.accel() | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| --[[ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Allanis
						Allanis