Jump to content

Is it ok to save objects outside of the functions?


Maris

Recommended Posts

  • 1 month later...

Storing data outside of the function is fine. However, you will not have the most up to date information so make sure you don't use it for something that needs to have the most up to date information.

 

Also, the code example you wrote there will only every get the body damage once. The reason for this is the `if not bd then`. This will only set it on the first pass then ignore setting the value for any other call of that function. This is assuming you don't have another section in the function that sets the value of bd.

 

Edited by Leond
Link to comment
Share on other sites

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