Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initial filter in object defs and adds test #2121

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Content.IntegrationTests/DMProject/Tests/filter_initial.dm
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions Content.IntegrationTests/DMProject/code.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
test_color_matrix()
test_range()
test_verb_duplicate()
test_filter_init()
world.log << "IntegrationTests successful, /world/New() exiting..."
1 change: 1 addition & 0 deletions Content.IntegrationTests/DMProject/environment.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions DMCompiler/DM/DMCodeTree.Vars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private bool IsValidRightHandSide(DMCompiler compiler, DMObject dmObject, DMExpr
"file" => true,
"sound" => true,
"nameof" => true,
"filter" => true,
_ => false
},

Expand Down
Loading