From 74a4f6aa82a3d6a89a6529fbd88aea5d8a2899b0 Mon Sep 17 00:00:00 2001 From: amylizzle Date: Wed, 4 Dec 2024 16:37:50 +0000 Subject: [PATCH 1/2] suprisingly easy fix --- DMCompiler/DM/DMCodeTree.Vars.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DMCompiler/DM/DMCodeTree.Vars.cs b/DMCompiler/DM/DMCodeTree.Vars.cs index 0657c8cccd..b259047fb3 100644 --- a/DMCompiler/DM/DMCodeTree.Vars.cs +++ b/DMCompiler/DM/DMCodeTree.Vars.cs @@ -74,6 +74,7 @@ private bool IsValidRightHandSide(DMCompiler compiler, DMObject dmObject, DMExpr "file" => true, "sound" => true, "nameof" => true, + "filter" => true, _ => false }, From a6867403725bae2bd7c2893e60063f9db3a7daaa Mon Sep 17 00:00:00 2001 From: amylizzle Date: Wed, 4 Dec 2024 16:41:31 +0000 Subject: [PATCH 2/2] test --- .../DMProject/Tests/filter_initial.dm | 16 ++++++++++++++++ Content.IntegrationTests/DMProject/code.dm | 1 + .../DMProject/environment.dme | 1 + 3 files changed, 18 insertions(+) create mode 100644 Content.IntegrationTests/DMProject/Tests/filter_initial.dm diff --git a/Content.IntegrationTests/DMProject/Tests/filter_initial.dm b/Content.IntegrationTests/DMProject/Tests/filter_initial.dm new file mode 100644 index 0000000000..65812623c0 --- /dev/null +++ b/Content.IntegrationTests/DMProject/Tests/filter_initial.dm @@ -0,0 +1,16 @@ +/obj/blurry + filters = filter(type="blur", size=2) + +/obj/veryblurry + filters = list(type="blur", size=4) + +/obj/notatallblurry + filters = list() + +/proc/test_filter_init() + var/obj/veryblurry/VB = new() + ASSERT(length(VB.filters) == 1) + var/obj/blurry/B = new() + ASSERT(length(B.filters) == 1) + var/obj/notatallblurry/NAB = new() + ASSERT(length(NAB.filters) == 0) \ No newline at end of file diff --git a/Content.IntegrationTests/DMProject/code.dm b/Content.IntegrationTests/DMProject/code.dm index ebb99dd087..22379ac075 100644 --- a/Content.IntegrationTests/DMProject/code.dm +++ b/Content.IntegrationTests/DMProject/code.dm @@ -30,4 +30,5 @@ test_color_matrix() test_range() test_verb_duplicate() + test_filter_init() world.log << "IntegrationTests successful, /world/New() exiting..." \ No newline at end of file diff --git a/Content.IntegrationTests/DMProject/environment.dme b/Content.IntegrationTests/DMProject/environment.dme index a4abe97328..f58687b514 100644 --- a/Content.IntegrationTests/DMProject/environment.dme +++ b/Content.IntegrationTests/DMProject/environment.dme @@ -3,5 +3,6 @@ #include "Tests/color_matrix.dm" #include "Tests/range.dm" #include "Tests/verb_duplicate.dm" +#include "Tests/filter_initial.dm" #include "map.dmm" #include "interface.dmf" \ No newline at end of file