From ca8552c4eb69b2b8267fe0046320bccf9f547b52 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 30 Sep 2021 02:02:29 +0200 Subject: 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. --- lib/Properties.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Properties.hs') 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" -- cgit v1.2.3