Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GarrisonHolder.js
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | GarrisonHolder.prototype.GetSpawnPosition = function(entity, forced) | ||||
if (pos.y < 0) | if (pos.y < 0) | ||||
{ | { | ||||
// Error: couldn't find space satisfying the unit's passability criteria | // Error: couldn't find space satisfying the unit's passability criteria | ||||
if (!forced) | if (!forced) | ||||
return null; | return null; | ||||
// If ejection is forced, we need to continue, so use center of the building | // If ejection is forced, we need to continue, so use center of the building | ||||
let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | ||||
pos = cmpPosition.GetPosition(); | pos = cmpPosition.IsInWorld() ? cmpPosition.GetPosition() : null; | ||||
} | } | ||||
return pos; | return pos; | ||||
}; | }; | ||||
/** | /** | ||||
* @param {number} entity - The entity ID of the entity to eject. | * @param {number} entity - The entity ID of the entity to eject. | ||||
* @param {boolean} forced - Whether eject is forced (e.g. if building is destroyed). | * @param {boolean} forced - Whether eject is forced (e.g. if building is destroyed). | ||||
* @return {boolean} Whether the entity was ejected. | * @return {boolean} Whether the entity was ejected. | ||||
▲ Show 20 Lines • Show All 359 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator