diff --git a/src/twn_textures.c b/src/twn_textures.c index 9be9ca4..9c61041 100644 --- a/src/twn_textures.c +++ b/src/twn_textures.c @@ -404,7 +404,7 @@ static TextureKey textures_load(TextureCache *cache, const char *path) { shput(cache->hash, path, new_texture); - uint16_t const id = (uint16_t)shgeti(cache->hash, path); + uint16_t const id = (uint16_t)shlenu(cache->hash) - 1; /* reuse this id for every later missing texture */ if (surface == missing_texture_surface)