itemdef: handle the !render-to-target case
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 8 Feb 2012 10:49:23 +0000 (11:49 +0100)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Fri, 24 Feb 2012 21:37:16 +0000 (22:37 +0100)
src/itemdef.cpp

index aa888bbdf20243a140b07c9ca7f4a9fa2b34bbb6..22ca9f088ebdbc4a015d53a8adfd39b391930a70 100644 (file)
@@ -417,7 +417,13 @@ public:
                                                light_position,
                                                light_color,
                                                light_radius);
-                                       // Note: might have returned NULL
+
+                                       // render-to-target didn't work
+                                       if(def->inventory_texture == NULL)
+                                       {
+                                               def->inventory_texture =
+                                                       tsrc->getTextureRaw(f.tname_tiles[0]);
+                                       }
                                }
 
                                /*