Guest User

Untitled

a guest
May 13th, 2022
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. function int GetOptimalZForTile(const vector VectorLocation)
  2. {
  3. local XComWorldData World;
  4. local TTile TileLocation;
  5. local array<StateObjectReference> TargetsOnTile;
  6.  
  7. World = `XWORLD;
  8.  
  9. TileLocation = World.GetTileCoordinatesFromPosition(VectorLocation);
  10. TargetsOnTile = World.GetUnitsOnTile(TileLocation);
  11.  
  12. return World.GetFloorZForPosition(VectorLocation) + class'XComWorldData'.const.WORLD_FloorHeight;
  13.  
  14. //// If there's a unit on the tile, or the tile contains a high cover object
  15. //if (TargetsOnTile.Length > 0 || World.IsLocationHighCover(VectorLocation))
  16. //{
  17. //// then we aim at a point a floor above the tile (around soldier's waist-chest level)
  18. //return World.GetFloorZForPosition(VectorLocation) + class'XComWorldData'.const.WORLD_FloorHeight;
  19. //}
  20. //else
  21. //{
  22. //// if the tile contains low cover object, then we aim slightly above the floor
  23. //if (World.IsLocationLowCover(VectorLocation))
  24. //{
  25. //return class'XComWorldData'.const.WORLD_HalfFloorHeight;
  26. //}
  27. //else
  28. //{
  29. //// otherwise we aim at floor
  30. //return World.GetFloorZForPosition(VectorLocation);
  31. //}
  32. //}
  33. }
Advertisement
Add Comment
Please, Sign In to add comment