diff options
author | stuebinm | 2021-09-30 02:02:29 +0200 |
---|---|---|
committer | stuebinm | 2021-09-30 02:02:29 +0200 |
commit | ca8552c4eb69b2b8267fe0046320bccf9f547b52 (patch) | |
tree | efda222c28b3d6267c89dd8b1793e4c6c259e53d /lib/Properties.hs | |
parent | 68af04a4da6ba4ec61d1469337ce53457526d861 (diff) |
simple map-map link dependency checking
This is purely based on a set difference, i.e. it won't catch stupid
things like a map linking to itself, a map link going only one-way, etc.
Also, it only handles map links; it doesn't check if all ressource files
referenced by a map actually exist.
Diffstat (limited to '')
-rw-r--r-- | lib/Properties.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs index 86acda9..877afe1 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -13,7 +13,8 @@ import Tiled2 (Layer (..), Property (..), PropertyValue (..), import Util (layerIsEmpty, prettyprint) import LintWriter (LintWriter, askContext, askFileDepth, complain, - dependsOn, forbid, suggest, warn) + dependsOn, forbid, offersEntrypoint, suggest, + warn) import Paths (RelPath (..), parsePath) import Types (Dep (Link, Local, LocalMap, MapLink)) @@ -142,6 +143,8 @@ checkLayerProperty p@(Property name _value) = case name of else unwrapPath link (dependsOn . LocalMap) "startLayer" -> do forbidEmptyLayer + layer <- askContext + offersEntrypoint $ layerName layer unwrapBool p $ \case True -> pure () False -> complain "startLayer must be set to true" |