load-art-image-chunk: safety check

develop
lethosor 2018-02-04 22:56:24 -05:00
parent 78061085c6
commit b2a19dedeb
1 changed files with 6 additions and 1 deletions

@ -188,6 +188,11 @@ command_result loadArtImageChunk(color_ostream &out, vector <string> & parameter
if (parameters.size() != 1) if (parameters.size() != 1)
return CR_WRONG_USAGE; return CR_WRONG_USAGE;
if (!Core::getInstance().isWorldLoaded())
{
out.printerr("No world loaded\n");
return CR_FAILURE;
}
GET_ART_IMAGE_CHUNK GetArtImageChunk = reinterpret_cast<GET_ART_IMAGE_CHUNK>(Core::getInstance().vinfo->getAddress("get_art_image_chunk")); GET_ART_IMAGE_CHUNK GetArtImageChunk = reinterpret_cast<GET_ART_IMAGE_CHUNK>(Core::getInstance().vinfo->getAddress("get_art_image_chunk"));
if (GetArtImageChunk) if (GetArtImageChunk)