Fix unreported: Grease Pencil "Add Masking Layer" operators duplicate check always returned nullptr

Original code used the wrong type of `BLI_findstring` function, leading
to the parameters being read incorrectly and the `MaskingLayer `duplicate
check working incorrectly.

This PR changed `BLI_findstring` to `BLI_findstring_ptr`, resulting in the
`LayerMask` names being read correctly and the duplcate check working
as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/134295
This commit is contained in:
Janne Nylander
2025-02-10 16:25:29 +01:00
committed by Falk David
parent aad0bd2148
commit 7451a1d016

View File

@@ -891,9 +891,9 @@ static int grease_pencil_layer_mask_add_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if (BLI_findstring(&active_layer.masks,
mask_name,
offsetof(GreasePencilLayerMask, layer_name)) != nullptr)
if (BLI_findstring_ptr(&active_layer.masks,
mask_name,
offsetof(GreasePencilLayerMask, layer_name)) != nullptr)
{
BKE_report(op->reports, RPT_ERROR, "Layer already added");
return OPERATOR_CANCELLED;