mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 10:29:00 +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:
1 parent
0322d039f6
commit
810d92bf8b
2 files changed
+6
-1
No files matched your search
@@ -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