kaminaris / MaxDps

Other
22 stars 14 forks source link

Check if the Player is Dragon Riding Instead of Mounted #32

Closed stophman1 closed 1 year ago

stophman1 commented 1 year ago

One of the returns for C_PlayerInfo.GetGlidingInfo() returns if a player is on a dragon riding mount and fires PLAYER_CAN_GLIDE_CHANGED when it changes. Unless if there is another reason why IsMounted() is used than dragon riding changing the hotbar, it would be better to check if a player is using a dragon riding mount and reenable the rotation when they dismount.

future-greg commented 1 year ago

Do you know how I could implement this in my own LUA versions for testing? I tried to replace the IsMounted() with C_PlayerInfo.GetGlidingInfo() in all instances, but maybe I'm not going about it the right away - I'm still kind of a novice at LUA coding/editing and learning as I go. I did go ahead and do that, however I noticed that when dragonriding, it's still auto-enabling the module and citing missing spells (due to the action bar paging).

stophman1 commented 1 year ago

C_PlayerInfo.GetGlidingInfo() returns 3 variables so it's not a drag and drop replacement. See https://wowpedia.fandom.com/wiki/API_C_PlayerInfo.GetGlidingInfo. You can do something like local isDragonriding = select(2,C_PlayerInfo.GetGlidingInfo()) to get the state of the boolean you want.

doadin commented 1 year ago

I chose mounted because it applies to both and rotation code does not need to run in either case.

stophman1 commented 1 year ago

I thought the errors were from the dragon riding hotbar. Can you explain the reasoning to apply it to regular mounts too?

doadin commented 1 year ago

The errors come from any change in action bars yes. So no it does not need to be done in order to stop the errors but, again why I added that is it stops the rotation so that the code is not constantly running in a situation where it is not needed. (As little resources it might be) As I said before "rotation code does not need to run in either case". You are correct though it is not needed to stop the error it is imo a optimization.

stophman1 commented 1 year ago

Could PLAYER_MOUNT_DISPLAY_CHANGED be used to reenable the rotation code when a player dismounts?

doadin commented 1 year ago

possible but why? I mean im not the author im just a contributor so its not up to me but just wondering.