From 8b0dee6f66a6a5e15630c44b9b8ac30a4aeb9f64 Mon Sep 17 00:00:00 2001 From: ZZYZX Date: Fri, 17 Feb 2017 21:59:03 +0200 Subject: [PATCH] My am dumb: PStruct is a base for PClass --- src/scripting/zscript/zcc_compile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 0c77b46f8..3afb80ff3 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2130,7 +2130,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool // [ZZ] supporting const self for actors is quite a cumbersome task because there's no concept of a const pointer (?) // either way, it doesn't make sense, because you can call any method on a readonly class instance. - if ((f->Flags & ZCC_FuncConst) && !(c->Type()->IsKindOf(RUNTIME_CLASS(PStruct)))) + if ((f->Flags & ZCC_FuncConst) && (c->Type()->IsKindOf(RUNTIME_CLASS(PClass)))) { Error(f, "'Const' on a method can only be used in structs"); }