{"record":{"id":"2119a371186619b6","repo":"egametang/ET","slug":"unsupported-jump-type-type","errorCode":null,"errorMessage":"Unsupported jump type {type}","messagePattern":"Unsupported jump type (.+?)","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.recast/Scripts/Core/Share/Detour.Extras/Jumplink/EdgeSamplerFactory.cs","lineNumber":21,"sourceCode":"\nnamespace DotRecast.Detour.Extras.Jumplink\n{\n    class EdgeSamplerFactory\n    {\n        public EdgeSampler Get(JumpLinkBuilderConfig acfg, JumpLinkType type, JumpEdge edge)\n        {\n            EdgeSampler es = null;\n            switch (type.Bit)\n            {\n                case JumpLinkType.EDGE_JUMP_BIT:\n                    es = InitEdgeJumpSampler(acfg, edge);\n                    break;\n                case JumpLinkType.EDGE_CLIMB_DOWN_BIT:\n                    es = InitClimbDownSampler(acfg, edge);\n                    break;\n                case JumpLinkType.EDGE_JUMP_OVER_BIT:\n                default:\n                    throw new ArgumentException(\"Unsupported jump type \" + type);\n            }\n\n            return es;\n        }\n\n\n        private EdgeSampler InitEdgeJumpSampler(JumpLinkBuilderConfig acfg, JumpEdge edge)\n        {\n            EdgeSampler es = new EdgeSampler(edge, new JumpTrajectory(acfg.jumpHeight));\n            es.start.height = acfg.agentClimb * 2;\n            RcVec3f offset = new RcVec3f();\n            Trans2d(ref offset, es.az, es.ay, new RcVec2f { x = acfg.startDistance, y = -acfg.agentClimb, });\n            Vadd(ref es.start.p, edge.sp, offset);\n            Vadd(ref es.start.q, edge.sq, offset);\n\n            float dx = acfg.endDistance - 2 * acfg.agentRadius;\n            float cs = acfg.cellSize;\n            int nsamples = Math.Max(2, (int)Math.Ceiling(dx / cs));","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.recast/Scripts/Core/Share/Detour.Extras/Jumplink/EdgeSamplerFactory.cs#L3-L39","documentation":"EdgeSamplerFactory.Get builds an EdgeSampler based on a JumpLinkType bit flag. Only EDGE_JUMP_BIT and EDGE_CLIMB_DOWN_BIT are implemented; the default case (which includes EDGE_JUMP_OVER_BIT and any other value) throws ArgumentException. This is a coverage gap — not all jump link types have samplers.","triggerScenarios":"Constructing jump links with a type whose Bit is EDGE_JUMP_OVER_BIT or any value not matching the two implemented cases; iterating over all JumpLinkType flags and passing each to the factory.","commonSituations":"Enabling EDGE_JUMP_OVER in a JumpLinkBuilderConfig but the sampler for it was never implemented; upgrading DotRecast where the enum gained new flags but the factory did not.","solutions":["Filter the jump link types you pass to only EDGE_JUMP_BIT and EDGE_CLIMB_DOWN_BIT.","If you need EDGE_JUMP_OVER, implement InitJumpOverSampler in a subclass or contribute the sampler upstream.","Check type.Bit against the supported set before calling Get."],"exampleFix":"// before\nforeach (var t in allJumpTypes)\n    builder.Build(acfg, t); // throws for EDGE_JUMP_OVER\n\n// after — filter supported types\nvar supported = new[] { JumpLinkType.EDGE_JUMP_BIT, JumpLinkType.EDGE_CLIMB_DOWN_BIT };\nforeach (var t in allJumpTypes.Where(j => supported.Contains(j.Bit)))\n    builder.Build(acfg, t);","handlingStrategy":"validation","validationCode":"var supported = new[] { JumpLinkType.EDGE_JUMP_BIT, JumpLinkType.EDGE_CLIMB_DOWN_BIT };\nif (!supported.Contains(type.Bit)) { /* skip unsupported jump type */ return; }","typeGuard":"static bool IsSupportedJumpType(JumpLinkType t) => t.Bit == JumpLinkType.EDGE_JUMP_BIT || t.Bit == JumpLinkType.EDGE_CLIMB_DOWN_BIT;","tryCatchPattern":null,"preventionTips":["Filter jump types to the two supported cases before building.","If EDGE_JUMP_OVER is needed, implement the sampler or subclass the factory.","Check type.Bit against the supported set defensively."],"tags":["recast","detour-extras","jumplink","navigation"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}