This repository was archived by the owner on Sep 24, 2021. It is now read-only.
basic optimizations and duplicate entity model check removal#20
Open
LRemp wants to merge 2 commits intobrentN5:mainfrom
Open
basic optimizations and duplicate entity model check removal#20LRemp wants to merge 2 commits intobrentN5:mainfrom
LRemp wants to merge 2 commits intobrentN5:mainfrom
Conversation
LiamDormon
suggested changes
Apr 30, 2021
Contributor
LiamDormon
left a comment
There was a problem hiding this comment.
Good changes but I would change GetPlayerPed(-1) to PlayerPedId()
bt-target/client/main.lua
Outdated
| function playerTargetEnable() | ||
| if success then return end | ||
| if IsPedArmed(PlayerPedId(), 6) then return end | ||
| local playerPed = GetPlayerPed(-1) -- Defining player ped id before running loop |
Contributor
There was a problem hiding this comment.
PlayerPedId() is more performant than GetPlayerPed(-1), not sure why you've swapped them here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed duplicate entity model check, since it doesn't make sense to check entity model twice.
Defined player ped id before loop and replaced unnecessary "PlayerPedId()" and "GetPlayerPed(-1)" calls with previously defined variable "playerPed".