mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-05 15:42:17 +03:00
feat(ui): implement Script_UnitXPMax
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
This commit is contained in:
parent
a53e1360a4
commit
315ea05ba0
@ -193,7 +193,23 @@ int32_t Script_UnitXP(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_UnitXPMax(lua_State* L) {
|
int32_t Script_UnitXPMax(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (!lua_isstring(L, 1)) {
|
||||||
|
luaL_error(L, "Usage: UnitXPMax(\"unit\")");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto name = lua_tostring(L, 1);
|
||||||
|
auto unit = Script_GetUnitFromName(name);
|
||||||
|
|
||||||
|
float xpMax = 0.0f;
|
||||||
|
|
||||||
|
if (unit && unit->IsA(TYPE_PLAYER)) {
|
||||||
|
xpMax = static_cast<CGPlayer_C*>(unit)->GetActiveNextLevelXP();
|
||||||
|
}
|
||||||
|
|
||||||
|
lua_pushnumber(L, xpMax);
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_UnitHealth(lua_State* L) {
|
int32_t Script_UnitHealth(lua_State* L) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user