mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
parent
7758c98e7c
commit
eb2ff98883
2 changed files with 13 additions and 1 deletions
|
|
@ -84,9 +84,14 @@ Auras.prototype.GetRangeOverlays = function()
|
|||
{
|
||||
const rangeOverlays = [];
|
||||
|
||||
// Check if this is a preview entity
|
||||
const cmpVisibility = Engine.QueryInterface(this.entity, IID_Visibility);
|
||||
const isPreview = cmpVisibility && cmpVisibility.GetPreview && cmpVisibility.GetPreview();
|
||||
|
||||
for (const name of this.GetAuraNames())
|
||||
{
|
||||
if (!this.IsRangeAura(name) || !this[name].isApplied)
|
||||
// For preview entities, show auras even if isApplied is false
|
||||
if (!this.IsRangeAura(name) || (!isPreview && !this[name].isApplied))
|
||||
continue;
|
||||
|
||||
const rangeOverlay = AuraTemplates.Get(name).rangeOverlay;
|
||||
|
|
@ -141,6 +146,12 @@ Auras.prototype.CalculateAffectedPlayers = function(name)
|
|||
|
||||
Auras.prototype.CanApply = function(name)
|
||||
{
|
||||
// Check if this is a preview entity via Visibility component
|
||||
// If it is, then we don't apply the aura
|
||||
const cmpVisibility = Engine.QueryInterface(this.entity, IID_Visibility);
|
||||
if (cmpVisibility && cmpVisibility.GetPreview && cmpVisibility.GetPreview())
|
||||
return false;
|
||||
|
||||
if (!AuraTemplates.Get(name).requiredTechnology)
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
to this list should be carefully considered -->
|
||||
<!-- Attack is needed for the Actor Viewer and attack range overlay -->
|
||||
<Attack merge=""/>
|
||||
<Auras merge=""/>
|
||||
<BuildRestrictions merge=""/>
|
||||
<Decay merge=""/>
|
||||
<Footprint merge=""/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue