diff --git a/src/textures/textures.h b/src/textures/textures.h index 6c1b8f717..a750515b3 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -27,6 +27,7 @@ public: bool isValid() const { return texnum > 0; } bool Exists() const { return texnum >= 0; } void SetInvalid() { texnum = -1; } + void SetNull() { texnum = 0; } bool operator ==(const FTextureID &other) const { return texnum == other.texnum; } bool operator !=(const FTextureID &other) const { return texnum != other.texnum; } FTextureID operator +(int offset) throw(); diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 08f26e530..eb11972f1 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -1473,16 +1473,23 @@ DEFINE_CLASS_PROPERTY(icon, S, Inventory) { PROP_STRING_PARM(i, 0); - defaults->Icon = TexMan.CheckForTexture(i, FTexture::TEX_MiscPatch); - if (!defaults->Icon.isValid()) + if (i == NULL || i[0] == '\0') { - // Don't print warnings if the item is for another game or if this is a shareware IWAD. - // Strife's teaser doesn't contain all the icon graphics of the full game. - if ((info->GameFilter == GAME_Any || info->GameFilter & gameinfo.gametype) && - !(gameinfo.flags&GI_SHAREWARE) && Wads.GetLumpFile(bag.Lumpnum) != 0) + defaults->Icon.SetNull(); + } + else + { + defaults->Icon = TexMan.CheckForTexture(i, FTexture::TEX_MiscPatch); + if (!defaults->Icon.isValid()) { - bag.ScriptPosition.Message(MSG_WARNING, - "Icon '%s' for '%s' not found\n", i, info->Class->TypeName.GetChars()); + // Don't print warnings if the item is for another game or if this is a shareware IWAD. + // Strife's teaser doesn't contain all the icon graphics of the full game. + if ((info->GameFilter == GAME_Any || info->GameFilter & gameinfo.gametype) && + !(gameinfo.flags&GI_SHAREWARE) && Wads.GetLumpFile(bag.Lumpnum) != 0) + { + bag.ScriptPosition.Message(MSG_WARNING, + "Icon '%s' for '%s' not found\n", i, info->Class->TypeName.GetChars()); + } } } }