ND-Framework / ND_Core

ND Framework core
https://discord.gg/nC82d8zvjM
GNU General Public License v3.0
53 stars 37 forks source link

Departments duplication patch #25

Closed bleachyblue closed 2 years ago

bleachyblue commented 2 years ago

Some users were experiencing issues with departments duplicating in game when attempting to edit/create characters. The start function is being called more than once, a variable has been created to ensure that the checkPerms event is only triggered once.

There's probably a slightly more efficient way to fix this issue however I don't fancy backtracking the code to prevent breaking changes.

bleachyblue commented 2 years ago

It was added there in the first attempt to fix the issue. (Before the started variable) I'm sure you could move it out of the block however will this make a difference? Unnecessary if statement running multiple times if it causes no issue.

Andyyy7666 commented 2 years ago

It was added there in the first attempt to fix the issue. (Before the started variable) I'm sure you could move it out of the block however will this make a difference? Unnecessary if statement running multiple times if it causes no issue.

I'll move it out because if the resource is restarted then switch will be false and if the player just spawns or changes characters using the command then switch will be true.