Ok, after some analysis of what is called and what's not, I ended up with modifying the CanAttack() condition :
public bool CanAttack()
{
var target = (SharedGameObject)bt.GetVariable("Player"); // bt being the BehaviourTree component attached to my character
float dist =...