Determine client version and use it to do things

Hi, I have a little function in my addon to leave an instance/group with a click on a button. LeaveParty() is different in retail and in wrath… How do I have to change the code to function properly?

function Leave_OnClick()
	DoEmote("Bye")
	interface_version = select(4, GetBuildInfo())
	If interface_version = 100200 then
		C_PartyInfo.LeaveParty()
	else
		LeaveParty()
	end
end

Thx,
Feli

function Leave_OnClick()
	DoEmote("Bye")
	If (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
		C_PartyInfo.LeaveParty()
	else
		LeaveParty()
	end
end
1 Like

Thank you very much :heart:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.