From f1ae8119ab62eef2caeae6d5ae54e85712ca9bc3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Oct 2008 16:13:05 +0000 Subject: [PATCH] - Fixed: FxClassTypeCast::Resolve didn't work for NULL classes because a variable was not initialized. SVN r1283 (trunk) --- docs/rh-log.txt | 4 ++++ src/thingdef/thingdef_expression.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ff3b59bf8d..25f7c51d85 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +October 29, 2008 (Changes by Graf Zahl) +- Fixed: FxClassTypeCast::Resolve didn't work for NULL classes because a variable + was not initialized. + October 28, 2008 (Changes by Graf Zahl) - Fixed: The railgun attack functions still read their puff parameters as names even though they are now passed as class pointers. diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index b3258353fd..1f345f264c 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -2474,8 +2474,8 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx) if (basex->isConstant()) { FName clsname = basex->EvalExpression(NULL).GetName(); - const PClass *cls; - + const PClass *cls = NULL; + if (clsname != NAME_None || !ctx.isconst) { cls= PClass::FindClass(clsname);