forked from mirrors/0ad
@@ -84,9 +84,14 @@ Auras.prototype.GetRangeOverlays = function()
|
|||||||
{
|
{
|
||||||
const rangeOverlays = [];
|
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())
|
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;
|
continue;
|
||||||
|
|
||||||
const rangeOverlay = AuraTemplates.Get(name).rangeOverlay;
|
const rangeOverlay = AuraTemplates.Get(name).rangeOverlay;
|
||||||
@@ -141,6 +146,12 @@ Auras.prototype.CalculateAffectedPlayers = function(name)
|
|||||||
|
|
||||||
Auras.prototype.CanApply = 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)
|
if (!AuraTemplates.Get(name).requiredTechnology)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
to this list should be carefully considered -->
|
to this list should be carefully considered -->
|
||||||
<!-- Attack is needed for the Actor Viewer and attack range overlay -->
|
<!-- Attack is needed for the Actor Viewer and attack range overlay -->
|
||||||
<Attack merge=""/>
|
<Attack merge=""/>
|
||||||
|
<Auras merge=""/>
|
||||||
<BuildRestrictions merge=""/>
|
<BuildRestrictions merge=""/>
|
||||||
<Decay merge=""/>
|
<Decay merge=""/>
|
||||||
<Footprint merge=""/>
|
<Footprint merge=""/>
|
||||||
|
|||||||
Reference in New Issue
Block a user