Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/helpers/Transform.js
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | if (newTemplate.Obstruction.Obstructions || | ||||
newTemplate.Obstruction.Unit["@radius"] > template.Obstruction.Unit["@radius"] || | newTemplate.Obstruction.Unit["@radius"] > template.Obstruction.Unit["@radius"] || | ||||
newTemplate.Obstruction.Unit && template.Obstruction.Static && | newTemplate.Obstruction.Unit && template.Obstruction.Static && | ||||
(newTemplate.Obstruction.Unit["@radius"] > template.Obstruction.Static["@width"] || | (newTemplate.Obstruction.Unit["@radius"] > template.Obstruction.Static["@width"] || | ||||
newTemplate.Obstruction.Unit["@radius"] > template.Obstruction.Static["@depth"])) | newTemplate.Obstruction.Unit["@radius"] > template.Obstruction.Static["@depth"])) | ||||
{ | { | ||||
var cmpNewObstruction = Engine.QueryInterface(previewEntity, IID_Obstruction); | var cmpNewObstruction = Engine.QueryInterface(previewEntity, IID_Obstruction); | ||||
if (cmpNewObstruction && cmpNewObstruction.GetBlockMovementFlag()) | if (cmpNewObstruction && cmpNewObstruction.GetBlockMovementFlag()) | ||||
{ | { | ||||
// Check for units | let collisions = cmpNewObstruction.GetEntityCollisions(); | ||||
var collisions = cmpNewObstruction.GetUnitCollisions(); | |||||
if (collisions.length) | if (collisions.length) | ||||
return DeleteEntityAndReturn(previewEntity, cmpPosition, pos, angle, cmpNewPosition, true); | return DeleteEntityAndReturn(previewEntity, cmpPosition, pos, angle, cmpNewPosition, true); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return DeleteEntityAndReturn(previewEntity, cmpPosition, pos, angle, cmpNewPosition, false); | return DeleteEntityAndReturn(previewEntity, cmpPosition, pos, angle, cmpNewPosition, false); | ||||
} | } | ||||
Show All 40 Lines |
Wildfire Games · Phabricator