Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GarrisonHolder.js
Context not available. | |||||
return false; | return false; | ||||
var cmpIdentity = Engine.QueryInterface(entity, IID_Identity); | var cmpIdentity = Engine.QueryInterface(entity, IID_Identity); | ||||
if (!cmpIdentity) | let cmpUnitAI = Engine.QueryInterface(entity, IID_UnitAI); | ||||
if (!cmpIdentity || !cmpUnitAI) | |||||
leper: Hm, UnitAI seems like a bad place for that. | |||||
return false; | return false; | ||||
var entityClasses = cmpIdentity.GetClassesList(); | var entityClasses = cmpIdentity.GetClassesList(); | ||||
return MatchesClassList(entityClasses, this.template.List._string); | return MatchesClassList(entityClasses, this.template.List._string) && cmpUnitAI.GarrisonEnabled(); | ||||
leperUnsubmitted Not Done Inline ActionsActually one could solve this with a special class that prevent garrisoning maybe aptly named Ungarrsionable. leper: Actually one could solve this with a special class that prevent garrisoning maybe aptly named… | |||||
SandaracAuthorUnsubmitted Not Done Inline ActionsHow would this be done with dynamic templates though? From what I can see, this would mean that the "Ungarrsionable" class would have to be added somehow to the Classes or VisibleClasses already present in the template? Or rather, I guess it's possible that GarrisonEnabled could be part of the Identity component, and then "Ungarrsionable" could be added to the ent's this.classesList on init if GarrisonEnabled is false. Sandarac: How would this be done with dynamic templates though? From what I can see, this would mean that… | |||||
leperUnsubmitted Not Done Inline ActionsThe same way that token merging works with inheritance. leper: The same way that token merging works with inheritance. | |||||
}; | }; | ||||
/** | /** | ||||
Context not available. |
Wildfire Games · Phabricator
Hm, UnitAI seems like a bad place for that.