diff --git a/UnitMethods.h b/UnitMethods.h index 142f19c..72c9f8f 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -675,7 +675,11 @@ namespace LuaUnit int GetPowerPct(lua_State* L, Unit* unit) { +#if (defined(MANGOS) && defined(WOTLK)) + float percent = (unit->GetPower(unit->GetPowerType()) / unit->GetMaxPower(unit->GetPowerType())) * 100; +#else float percent = (unit->GetPower(unit->getPowerType()) / unit->GetMaxPower(unit->getPowerType())) * 100; +#endif sEluna->Push(L, percent); return 1; }