mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: resolve compiler warnings in lua_engine and game_screen
Remove unused getPlayerUnit() helper in lua_engine.cpp (-Wunused-function). Increase countStr buffer from 8 to 16 bytes in action bar item count display to eliminate -Wformat-truncation warning for %d with int32_t. Build is now warning-free.
This commit is contained in:
parent
4b6ed04926
commit
d1bcd2f844
2 changed files with 1 additions and 10 deletions
|
|
@ -59,15 +59,6 @@ static int lua_wow_message(lua_State* L) {
|
||||||
return lua_wow_print(L);
|
return lua_wow_print(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper: get player Unit from game handler
|
|
||||||
static game::Unit* getPlayerUnit(lua_State* L) {
|
|
||||||
auto* gh = getGameHandler(L);
|
|
||||||
if (!gh) return nullptr;
|
|
||||||
auto entity = gh->getEntityManager().getEntity(gh->getPlayerGuid());
|
|
||||||
if (!entity) return nullptr;
|
|
||||||
return dynamic_cast<game::Unit*>(entity.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper: resolve WoW unit IDs to GUID
|
// Helper: resolve WoW unit IDs to GUID
|
||||||
static uint64_t resolveUnitGuid(game::GameHandler* gh, const std::string& uid) {
|
static uint64_t resolveUnitGuid(game::GameHandler* gh, const std::string& uid) {
|
||||||
if (uid == "player") return gh->getPlayerGuid();
|
if (uid == "player") return gh->getPlayerGuid();
|
||||||
|
|
|
||||||
|
|
@ -9412,7 +9412,7 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (totalCount > 0) {
|
if (totalCount > 0) {
|
||||||
char countStr[8];
|
char countStr[16];
|
||||||
snprintf(countStr, sizeof(countStr), "%d", totalCount);
|
snprintf(countStr, sizeof(countStr), "%d", totalCount);
|
||||||
ImVec2 btnMax = ImGui::GetItemRectMax();
|
ImVec2 btnMax = ImGui::GetItemRectMax();
|
||||||
ImVec2 tsz = ImGui::CalcTextSize(countStr);
|
ImVec2 tsz = ImGui::CalcTextSize(countStr);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue