Hmm... Weird...
I just changed all the "static" in load_objective to "new" and it works.
Reseting ent to -1 before the 2nd loop in logevent_round_ent doesn't make a difference (as expected).
Could you go in detail on what variables I should put as global variables for my load_objective function?