Add Game::Lua::PushBool helper, sweep condition ? 1 : 0 patterns

PushBool(L, bool) wraps lua_pushboolean and centralizes the bool→int
conversion the engine ABI requires. All ~50 sites doing
`PushBoolean(L, condition ? 1 : 0)` collapse to `PushBool(L, condition)`.
Non-PushBoolean callers passing bool→int (Fire_*, FireGetItemInfoReceived,
etc.) switched to `static_cast<int>(...)`. NameCache settings file output
relies on the default ostream bool→"0"/"1" formatting.

Literal `PushBoolean(L, 0)` / `PushBoolean(L, 1)` left alone — they're
already explicit int values.
This commit is contained in:
Brues
2026-05-16 21:39:46 -05:00
parent 24ed233c4f
commit 90a580d75d
27 changed files with 110 additions and 109 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ void ProcessKeyMessage(UINT msg, WPARAM wParam, LPARAM lParam) {
// and the index may shift.
const int slot = Event::Custom::Lookup(kModifierStateChanged);
if (slot >= 0)
Event::Custom::Fire_SD(slot, kKeyName[bitIdx], nowDown ? 1 : 0);
Event::Custom::Fire_SD(slot, kKeyName[bitIdx], static_cast<int>(nowDown));
}
LRESULT CALLBACK GetMsgHook(int code, WPARAM wParam, LPARAM lParam) {