Skip to content
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
LRemp:main
Open

basic optimizations and duplicate entity model check removal#20
LRemp wants to merge 2 commits intobrentN5:mainfrom
LRemp:main

Conversation

@LRemp
Copy link

@LRemp LRemp commented Apr 28, 2021

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

Copy link
Contributor

@LiamDormon LiamDormon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes but I would change GetPlayerPed(-1) to PlayerPedId()

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlayerPedId() is more performant than GetPlayerPed(-1), not sure why you've swapped them here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants