Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function int GetOptimalZForTile(const vector VectorLocation)
- {
- local XComWorldData World;
- local TTile TileLocation;
- local array<StateObjectReference> TargetsOnTile;
- World = `XWORLD;
- TileLocation = World.GetTileCoordinatesFromPosition(VectorLocation);
- TargetsOnTile = World.GetUnitsOnTile(TileLocation);
- return World.GetFloorZForPosition(VectorLocation) + class'XComWorldData'.const.WORLD_FloorHeight;
- //// If there's a unit on the tile, or the tile contains a high cover object
- //if (TargetsOnTile.Length > 0 || World.IsLocationHighCover(VectorLocation))
- //{
- //// then we aim at a point a floor above the tile (around soldier's waist-chest level)
- //return World.GetFloorZForPosition(VectorLocation) + class'XComWorldData'.const.WORLD_FloorHeight;
- //}
- //else
- //{
- //// if the tile contains low cover object, then we aim slightly above the floor
- //if (World.IsLocationLowCover(VectorLocation))
- //{
- //return class'XComWorldData'.const.WORLD_HalfFloorHeight;
- //}
- //else
- //{
- //// otherwise we aim at floor
- //return World.GetFloorZForPosition(VectorLocation);
- //}
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment