Find if Unit is mounted.

UI and Macro
Is there some way to find if a unit is mounted without checking buffs against every mount spell in the game? IsMounted() is self only and GetUnitSpeed() only has flight speed, ground mount and unit speed are 1 arg so you can't tell the difference between a ground mount and normal speed buffs like sprint etc. There has to be a better way to tell if a party member is mounted?
One kludgy way is to make an array of mount buffs, and check each against the buffs of the target. Which you've ruled out.

Perhaps you could tell us why you need to know if a unit is mounted.

You can determine a units current speed by;
ceil(select(1,GetUnitSpeed("player"))/7*100)That'll give you current speed in percent.
I just want to display a mounted icon beside party frames, I did use getunitspeed for now but I think the icon will show up for sprint etc. I could create a buff blacklist I guess, easier than creating a mount whitelist.

A quick one I put together for Pitbulls built in lua text.
local currentSpeed, runSpeed, flightSpeed, swimSpeed = GetUnitSpeed(unit)
if ((runSpeed > 15 or flightSpeed > 15) and not UnitInVehicle(unit)) then return "|TInterface\\Icons\\achievement_guildperk_mountup:16|t" end

Join the Conversation

Return to Forum