ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Bug Reports (https://www.esoui.com/forums/forumdisplay.php?f=187)
-   -   [notabug]GetTargetMountedStateInfo() issues (https://www.esoui.com/forums/showthread.php?t=10715)

sinnereso 10/24/23 04:25 PM

[notabug]GetTargetMountedStateInfo() issues
 
Code:

local _, isRidingGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName)
Returns true / true for isRidingGroupMount / hasFreePassengerSlot when the "playerDisplayName" has ONLY selected a dual rider mount in collections and is NOT mounted.

Will return false / false ONLY if "playerDisplayName" has a regular single seat mount selected in collections.

ZOS_DanBatson 10/25/23 12:06 PM

Quote:

Originally Posted by sinnereso (Post 48653)
Code:

local _, isRidingGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName)
Returns true / true for isRidingGroupMount / hasFreePassengerSlot when the "playerDisplayName" has ONLY selected a dual rider mount in collections and is NOT mounted.

Will return false / false ONLY if "playerDisplayName" has a regular single seat mount selected in collections.

isRidingGroupMountis a bit poorly named. It actually should be called hasActiveGroupMount, because it just refers to what kind of mount you've equipped in collections, not whether or not you are mounted currently. That's what the first arg you're ignoring is for. This is how we do it in vanilla:

Code:

local mountedState, isRidingGroupMount = GetTargetMountedStateInfo(currentTargetCharacterNameRaw)
local isPassengerForTarget = IsGroupMountPassengerForTarget(currentTargetCharacterNameRaw)
local groupMountEnabled = (mountedState == MOUNTED_STATE_MOUNT_RIDER and isRidingGroupMount and (not IsMounted() or isPassengerForTarget))


sinnereso 10/25/23 02:05 PM

Quote:

Originally Posted by ZOS_DanBatson (Post 48659)
isRidingGroupMountis a bit poorly named. It actually should be called hasActiveGroupMount, because it just refers to what kind of mount you've equipped in collections, not whether or not you are mounted currently. That's what the first arg you're ignoring is for. This is how we do it in vanilla:

Code:

local mountedState, isRidingGroupMount = GetTargetMountedStateInfo(currentTargetCharacterNameRaw)
local isPassengerForTarget = IsGroupMountPassengerForTarget(currentTargetCharacterNameRaw)
local groupMountEnabled = (mountedState == MOUNTED_STATE_MOUNT_RIDER and isRidingGroupMount and (not IsMounted() or isPassengerForTarget))


the issue is its returning true for "isRidingGroupMount" & "hasFree Passenger Slot" when they are standing on foot unmounted with only a group mount selected in collections... they both turn false when they select a single seat mount and are still unmounted. It previously did function correctly in the past. Sometime within the last 6mo it has changed.

Baertram 10/25/23 02:19 PM

Quote:

If what your saying is true then "hasFreePassengerSlot" would always be true as they are not even mounted on it for someone to ever be sitting in it.
1st: It is true, and he even explained what the API function returns.
As I guessed before you need to take it in combination with the 1st parameter "isMounted" to find out what exactly is happening here, as the other 2 params only relate to the collections.

2nd: The 3rd param "hasFreePassengerSlot" should have these states, on the following dependencies:
Multirider mount selected in collections / Owner unmounted: true
Multirider mount selected in collections / Owner mounted: true if a slot is free, false if someone else is riding along as a passenger on this mount already
Multirider mount not selected in collections / Owner mounted or unmounted: false

At least that is what I'd assume.

And if this behavior changed in the past, which always is possible, then I guess Dan's answer is still valid and true: Current version returns what he described.

sirinsidiator 10/25/23 02:42 PM

To me it sounds as if it is working correctly and you are just misunderstanding what should be happening?

When the player has the mount equipped but is not mounted, it should return false, true, true, because they do indeed use a mount with more than one seat and the passenger slot is free.

sinnereso 10/25/23 03:10 PM

Yes I was just looking at all the possible combos as well and came to this conclusion that using all 3 params it is possible to determine if theyre mounted on multi rider and seat available.


All times are GMT -6. The time now is 07:04 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI