Index: binaries/data/mods/public/globalscripts/Templates.js =================================================================== --- binaries/data/mods/public/globalscripts/Templates.js +++ binaries/data/mods/public/globalscripts/Templates.js @@ -459,12 +459,23 @@ } if (template.WallPiece) + { + let length = +template.WallPiece.Length; + + if (ret.obstruction && ret.obstruction.shape.type == "static") + { + let obstruction = Math.max(ret.obstruction.shape.depth, ret.obstruction.shape.width); + if (length < obstruction) + warn("Template with parent " + template["@parent"] + " has a wall piece length (" + length + ") shorter than obstruction (" + obstruction + ")"); + } + ret.wallPiece = { - "length": +template.WallPiece.Length, + "length": length, "angle": +(template.WallPiece.Orientation || 1) * Math.PI, "indent": +(template.WallPiece.Indent || 0), "bend": +(template.WallPiece.Bend || 0) * Math.PI }; + } return ret; } Index: source/tools/entity/checkrefs.pl =================================================================== --- source/tools/entity/checkrefs.pl +++ source/tools/entity/checkrefs.pl @@ -105,6 +105,17 @@ { push @deps, [ $path, "art/textures/ui/session/portraits/" . $ent->{Entity}{Identity}{Icon}{' content'} ] if $ent->{Entity}{Identity}{Icon}; } + if ($ent->{Entity}{Obstruction}{Static} and $ent->{Entity}{WallPiece}) + { + my $obstructionDepth = $ent->{Entity}{Obstruction}{Static}{'@depth'}{' content'}; + my $obstructionWidth = $ent->{Entity}{Obstruction}{Static}{'@width'}{' content'}; + my $obstruction = ($obstructionDepth, $obstructionWidth)[$obstructionDepth < $obstructionWidth]; + my $wallPiece = $ent->{Entity}{WallPiece}{Length}{' content'}; + if ($wallPiece < $obstruction) + { + warn $f . " WallPiece length (" . $wallPiece . ") is shorter than Obstruction size (" . $obstruction . ")"; + } + } } } }