Fix autoscale_mode segfault if tile doesn't have texture

closes #9965
This commit is contained in:
sfan5 2020-06-01 21:19:35 +02:00
parent 42a9b45c21
commit 0e698e63b3

@ -608,8 +608,9 @@ static void fillTileAttribs(ITextureSource *tsrc, TileLayer *layer,
layer->material_type = material_type; layer->material_type = material_type;
bool has_scale = tiledef.scale > 0; bool has_scale = tiledef.scale > 0;
if (((tsettings.autoscale_mode == AUTOSCALE_ENABLE) && !has_scale) || bool use_autoscale = tsettings.autoscale_mode == AUTOSCALE_FORCE ||
(tsettings.autoscale_mode == AUTOSCALE_FORCE)) { (tsettings.autoscale_mode == AUTOSCALE_ENABLE && !has_scale);
if (use_autoscale && layer->texture) {
auto texture_size = layer->texture->getOriginalSize(); auto texture_size = layer->texture->getOriginalSize();
float base_size = tsettings.node_texture_size; float base_size = tsettings.node_texture_size;
float size = std::fmin(texture_size.Width, texture_size.Height); float size = std::fmin(texture_size.Width, texture_size.Height);