Skip to content

Commit

Permalink
Fix initial filter in object defs and adds test (#2121)
Browse files Browse the repository at this point in the history
Co-authored-by: amylizzle <[email protected]>
  • Loading branch information
amylizzle and amylizzle authored Dec 4, 2024
1 parent e2df05e commit e638422
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
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

0 comments on commit e638422

Please sign in to comment.