Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/BuildRestrictions.js
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | BuildRestrictions.prototype.CheckPlacement = function() | ||||
default: | default: | ||||
passClassName = "building-land"; | passClassName = "building-land"; | ||||
} | } | ||||
var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | ||||
if (!cmpObstruction) | if (!cmpObstruction) | ||||
return result; // Fail | return result; // Fail | ||||
var ret = cmpObstruction.CheckFoundation(passClassName); | |||||
if (this.template.Category == "Wall") | |||||
{ | |||||
// for walls, only test the center point | |||||
var ret = cmpObstruction.CheckFoundation(passClassName, true); | |||||
} | |||||
else | |||||
{ | |||||
var ret = cmpObstruction.CheckFoundation(passClassName, false); | |||||
} | |||||
if (ret != "success") | if (ret != "success") | ||||
{ | { | ||||
switch (ret) | switch (ret) | ||||
{ | { | ||||
case "fail_error": | case "fail_error": | ||||
case "fail_no_obstruction": | case "fail_no_obstruction": | ||||
error("CheckPlacement: Error returned from CheckFoundation"); | error("CheckPlacement: Error returned from CheckFoundation"); | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator