Fix crash in Material:setTexture;

This commit is contained in:
bjorn 2021-07-10 09:42:49 -07:00
parent f959770396
commit e2cad4ed81
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ Texture* lovrMaterialGetTexture(Material* material, MaterialTexture textureType)
void lovrMaterialSetTexture(Material* material, MaterialTexture textureType, Texture* texture) {
if (material->textures[textureType] != texture) {
lovrAssert(lovrTextureGetType(texture) == TEXTURE_2D, "Material textures must be 2D");
lovrAssert(!texture || lovrTextureGetType(texture) == TEXTURE_2D, "Material textures must be 2D");
lovrGraphicsFlushMaterial(material);
lovrRetain(texture);
lovrRelease(material->textures[textureType], lovrTextureDestroy);