From 02523b1f90d8c3d971d0949c9b9efbde1b28896b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Sun, 2 Mar 2025 16:58:37 -0300 Subject: [PATCH] restrict internal structs to gzdoom.pk3 --- src/common/scripting/frontend/zcc_compile.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/scripting/frontend/zcc_compile.cpp b/src/common/scripting/frontend/zcc_compile.cpp index fb49cf39a4..2eff4dab05 100644 --- a/src/common/scripting/frontend/zcc_compile.cpp +++ b/src/common/scripting/frontend/zcc_compile.cpp @@ -760,7 +760,14 @@ void ZCCCompiler::CreateStructTypes() if (s->strct->Flags & ZCC_Internal) { - s->strct->Type->TypeInternal = true; + if(fileSystem.GetFileContainer(Lump) == 0) + { + s->strct->Type->TypeInternal = true; + } + else + { + Error(s->strct, "Internal structs are only allowed in the root pk3"); + } } auto &sf = s->Type()->ScopeFlags;