seronis Posted February 20, 2015 Share Posted February 20, 2015 Is the penalty applied in a sanityaura really supposed to be applied globally, ignoring distance to player? In the sanity component you see the following code for determining penalty:function Sanity:RecalculatePenalty() self.penalty = 0 for k,v in pairs(Ents) do if v.components.sanityaura and v.components.sanityaura.penalty then self.penalty = self.penalty + v.components.sanityaura.penalty end end self:DoDelta(0)endUnless im forgetting something 'Ents' is the global entity list. The code above isnt checking how far away these sources are. Is this intended behavior ? Link to comment Share on other sites More sharing options...
Mobbstar Posted February 20, 2015 Share Posted February 20, 2015 Is it used by the game? No. Is it possibly more complicated to arrange than it seems at first? I don't know. Link to comment Share on other sites More sharing options...
seronis Posted February 20, 2015 Author Share Posted February 20, 2015 Except it is called by the game. GameLogic.lua line 873 during world init. Err also shadowwaxwell.lua line 29 and waxwelljournal.lua line 53. So its being used by the game definitely. Im just curious if its a bug that distances are not checked. Link to comment Share on other sites More sharing options...
Blueberrys Posted February 20, 2015 Share Posted February 20, 2015 @seronis The sanity penalty is not applied to the current sanity, but to the max sanity.(sanity.lua)function Sanity:GetMaxSanity() return (self.max - self.penalty)endYou are correct that it checks globally, and that is the intended behaviour. Shadowwaxwell decreases the player's max sanity when spawned, regardless of where he is in the world. Link to comment Share on other sites More sharing options...
seronis Posted February 20, 2015 Author Share Posted February 20, 2015 Yeah i know its applying to max sanity which will drop your current sanity if it was above the new max. Im making some personal tweaks to how max sanity is determined and I wanted to make sure I wasnt making bad assumptions about the penalty, and if this was considered a bug i was just gonna fix the bug in my code. And mostly since im making max sanity a dynamically changing thing i didnt want to introduce any bugs as i mess around with it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.