mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix auras taking effect in building previews
Auras.CanApply called Visibility's GetPreview(), which doesn't exist,
so auras were applying in preview. Introduced in eb2ff98883.
Add GetPreview() to Visibility.
Fixes #9225
This commit is contained in:
@@ -156,7 +156,7 @@ Auras.prototype.CanApply = function(name)
|
||||
{
|
||||
// Check if this is a preview entity
|
||||
const cmpVisibility = Engine.QueryInterface(this.entity, IID_Visibility);
|
||||
if (cmpVisibility && cmpVisibility.GetPreview && cmpVisibility.GetPreview())
|
||||
if (cmpVisibility?.GetPreview())
|
||||
return false;
|
||||
|
||||
return this.AreTechnologyRequirementsMet(name);
|
||||
|
||||
@@ -94,4 +94,9 @@ Visibility.prototype.GetAlwaysVisible = function()
|
||||
return this.alwaysVisible;
|
||||
};
|
||||
|
||||
Visibility.prototype.GetPreview = function()
|
||||
{
|
||||
return this.preview;
|
||||
};
|
||||
|
||||
Engine.RegisterComponentType(IID_Visibility, "Visibility", Visibility);
|
||||
|
||||
Reference in New Issue
Block a user