(04-13-2012, 02:06 AM)DRedshot Wrote: I bolded the thing you missed. You had to recalculate the current sanity after modifying it with the sanityFactor.
Also, I changed a '>' to a '>=' because sanity doesn't recover in light. You are in light when sanity is equal to it's previous value ![Smile Smile](https://www.frictionalgames.com/forum/images/smilies/smile.gif)
Hope this helps.
Edit: Bold doesn't work in code format :/
Also, I'd lower the sanity factor by quite a lot, losing 20 sanity per second seems a bit too much, maybe make it = 0.5-1
Yeah, I was staring at my code for a while and noticed the <=. And I was making it lose a lot to speed up the effect for testing. But would you look at that? It works now! (with the addition of that extra
curSanity = GetPlayerSanity();) I thought that because I hadn't changed curSanity in the Update method, I wouldn't need that.