Skip to content

Commit

Permalink
UPBGE: Fix mathutils callbacks registration.
Browse files Browse the repository at this point in the history
The assertion in Mathutils_RegisterCallback was raised when all the callbacks
were registered (freestyle and bmesh too).
But this assertion introduced in 1b74ec9 is wrong. The test i + 1 < MAX
suppose that the last callback is a null sentinel. But this is not the
case as no one is using this to stop a loop and the loop in
Mathutils_RegisterCallback must stop when it find a null slot or that the
slot is already containing the callback, otherwise it's an error.
It's impossible to stop the loop with all regular slots registered and
and different from the one intenting to register.

Fix a part of issue #785.
  • Loading branch information
panzergame committed Aug 10, 2018
1 parent 9955dcd commit f30d10d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/blender/python/mathutils/mathutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ unsigned char Mathutils_RegisterCallback(Mathutils_Callback *cb)
return i;
}

BLI_assert(i + 1 < MATHUTILS_TOT_CB);
BLI_assert(i < MATHUTILS_TOT_CB);

mathutils_callbacks[i] = cb;
return i;
Expand Down

0 comments on commit f30d10d

Please sign in to comment.