diff options
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemPainting.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Items/ItemPainting.h b/src/Items/ItemPainting.h index dd35931dd..3432583ca 100644 --- a/src/Items/ItemPainting.h +++ b/src/Items/ItemPainting.h @@ -71,7 +71,12 @@ public: }; cPainting * Painting = new cPainting(gPaintingTitlesList[a_World->GetTickRandomNumber(ARRAYCOUNT(gPaintingTitlesList) - 1)].Title, a_BlockFace, a_BlockX, a_BlockY, a_BlockZ); - Painting->Initialize(*a_World); + if (!Painting->Initialize(*a_World)) + { + delete Painting; + Painting = nullptr; + return false; + } if (!a_Player->IsGameModeCreative()) { |