Skip to content

Improve Base Weapon Class Performance#34

Open
stickz wants to merge 1 commit intoRemscar:masterfrom
stickz:patch-23
Open

Improve Base Weapon Class Performance#34
stickz wants to merge 1 commit intoRemscar:masterfrom
stickz:patch-23

Conversation

@stickz
Copy link
Contributor

@stickz stickz commented Apr 4, 2016

  • Eliminate an un-needed if statement within think code by just setting the "IsLaserOn" boolean to the opposite value of self.Weapon:GetNetworkedBool("Reloading") directly as a function argument.
  • The ! operator automatically changes a boolean to it's opposite value without needing an if-else.
  • There's a way to do reloading like in TTT without think code. This would significantly improve code performance as all the weapons inherent from this class; but, I don't know how to do this.

- Eliminate an un-needed if statement within think code by just setting the "IsLaserOn" boolean to the opposite value of self.Weapon:GetNetworkedBool("Reloading") directly as a function argument. (this actually works!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant