Differential D577 Diff 2336 ps/trunk/binaries/data/mods/public/simulation/components/UnitMotionFlying.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/UnitMotionFlying.js
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | else if (this.speed == 0 && this.onGround) | ||||
this.pitch = 0; | this.pitch = 0; | ||||
// We've stopped. | // We've stopped. | ||||
if (cmpGarrisonHolder) | if (cmpGarrisonHolder) | ||||
cmpGarrisonHolder.AllowGarrisoning(true,"UnitMotionFlying"); | cmpGarrisonHolder.AllowGarrisoning(true,"UnitMotionFlying"); | ||||
canTurn = false; | canTurn = false; | ||||
this.hasTarget = false; | this.hasTarget = false; | ||||
this.landing = false; | this.landing = false; | ||||
// summon planes back from the edge of the map | // summon planes back from the edge of the map | ||||
var terrainSize = cmpTerrain.GetTilesPerSide() * 4; | var terrainSize = cmpTerrain.GetMapSize(); | ||||
var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); | var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); | ||||
if (cmpRangeManager.GetLosCircular()) | if (cmpRangeManager.GetLosCircular()) | ||||
{ | { | ||||
var mapRadius = terrainSize/2; | var mapRadius = terrainSize/2; | ||||
var x = pos.x - mapRadius; | var x = pos.x - mapRadius; | ||||
var z = pos.z - mapRadius; | var z = pos.z - mapRadius; | ||||
var div = (mapRadius - 12) / Math.sqrt(x*x + z*z); | var div = (mapRadius - 12) / Math.sqrt(x*x + z*z); | ||||
if (div < 1) | if (div < 1) | ||||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator