diff --git a/src/gl/textures/gl_hqresize.cpp b/src/gl/textures/gl_hqresize.cpp index c4a61f758e..55cf88fb19 100644 --- a/src/gl/textures/gl_hqresize.cpp +++ b/src/gl/textures/gl_hqresize.cpp @@ -289,8 +289,8 @@ unsigned char *gl_CreateUpsampledTextureBuffer ( const FTexture *inputTexture, u outWidth = inWidth; outHeight = inHeight; #ifdef HAVE_MMX - // ASM-hqNx does not preserve the alpha channel so fall back to C-version for such textures - if (!hasAlpha && type > 6 && type <= 9) + // hqNx MMX does not preserve the alpha channel so fall back to C-version for such textures + if (hasAlpha && type > 6 && type <= 9) { type -= 3; } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index ac5988a770..2c7f8633d3 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4558,7 +4558,7 @@ bool GetVarAddrType(AActor *self, FName varname, int index, void *&addr, PType * addr = baddr; // We don't want Int subclasses like Name or Color to be accessible, // but we do want to support Float subclasses like Fixed. - if (!type->IsA(RUNTIME_CLASS(PInt)) || !type->IsKindOf(RUNTIME_CLASS(PFloat))) + if (!type->IsA(RUNTIME_CLASS(PInt)) && !type->IsKindOf(RUNTIME_CLASS(PFloat))) { // For reading, we also support Name and String types. if (readonly && (type->IsA(RUNTIME_CLASS(PName)) || type->IsA(RUNTIME_CLASS(PString)))) diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index b2204066d4..cd893f13fe 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -525,17 +525,12 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl // Read the type and make sure it's acceptable. sc.MustGetAnyToken(); - switch (sc.TokenType) + if (sc.TokenType != TK_Int && sc.TokenType != TK_Float) { - case TK_Int: type = TypeSInt32; break; - case TK_Float: type = TypeFloat64; break; - case TK_String: type = TypeString; break; - default: - type = TypeError; - sc.ScriptMessage("User variables must be of type 'int' or 'float' or 'string'"); + sc.ScriptMessage("User variables must be of type 'int' or 'float'"); FScriptPosition::ErrorCounter++; - break; } + type = sc.TokenType == TK_Int ? (PType *)TypeSInt32 : (PType *)TypeFloat64; sc.MustGetToken(TK_Identifier); // For now, restrict user variables to those that begin with "user_" to guarantee @@ -582,7 +577,7 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl sc.MustGetToken(';'); PField *sym = cls->AddField(symname, type, 0); - if (cls == NULL) + if (sym == NULL) { sc.ScriptMessage ("'%s' is already defined in '%s'.", symname.GetChars(), cls ? cls->TypeName.GetChars() : "Global");