Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global"GetItemGuid" Should be treated differently #140

Open
GoMateoGo opened this issue May 27, 2023 · 4 comments
Open

global"GetItemGuid" Should be treated differently #140

GoMateoGo opened this issue May 27, 2023 · 4 comments

Comments

@GoMateoGo
Copy link

There are currently 2 types of 'GetItemGuid'

  1. Roll

  2. Global

When using global GetItemGuid (lowGuid), it defaults to executing roll first

These two types should be treated differently

@GoMateoGo
Copy link
Author

By modifying roll: GetItemGuid

Can changing the capitalization of method names or other methods solve the problem?

I'm not sure how to solve this problem more reasonably

@r-o-b-o-t-o
Copy link
Member

It correctly executes the global one for me.
Do you have a minimal reproducible example?
Also what OS is your AzerothCore running?

@GoMateoGo
Copy link
Author

GoMateoGo commented May 31, 2023

OS: Win11 22621.1778

  1. You can view characters.instance_ Is the item.guid consistent with the lGuid printing

  2. Record the printed value of hGuid

  3. Please modify or comment out roll: GetItemGuid for compilation

  4. Run the example here to view the hGuid printed value and compare it with the previous value

I accidentally discovered this

example:

RegisterItemEvent(6948, 2, function (event, player, item, target)
    local lGuid = item:GetGUIDLow()
    print("lGuid=",lGuid)
    local hGuid = GetItemGUID(lGuid)
    print("hGuid=",hGuid)
    local mlguid = item:GetGUID()
    print("mlguid=",mlguid)

    -----------The correct approach
    --local guid = item:GetGUID()
    --print("guid=",guid)
    --local items = player:GetItemByGUID( guid )
    --print("items",items:GetEntry())
 end)

@GoMateoGo
Copy link
Author

I don't know why, every time I use 'code' preview, it always doesn't match my expectations

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

No branches or pull requests

2 participants