Jump to content

Recommended Posts

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)end

Unless im forgetting something 'Ents' is the global entity list.  The code above isnt checking how far away these sources are.  Is this intended behavior ?

Edited by seronis

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.

Edited by seronis

@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)end

You 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.

 

Edited by Blueberrys

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.

Edited by seronis

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...