scripting.h fix + input library

This commit is contained in:
MihailRis
2024-05-05 00:28:30 +03:00
parent f9dd865bee
commit f02edcf15a
12 changed files with 121 additions and 34 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ void scripting::on_frontend_init(Hud* hud) {
scripting::state->openlib("hud", hudlib, 0);
for (auto& pack : scripting::engine->getContentPacks()) {
emit_event(pack.id + ".hudopen", [&] (lua::LuaState* state) {
state->emit_event(pack.id + ".hudopen", [&] (lua::LuaState* state) {
state->pushinteger(hud->getPlayer()->getId());
return 1;
});
@@ -34,7 +34,7 @@ void scripting::on_frontend_init(Hud* hud) {
void scripting::on_frontend_close() {
for (auto& pack : scripting::engine->getContentPacks()) {
emit_event(pack.id + ".hudclose", [&] (lua::LuaState* state) {
state->emit_event(pack.id + ".hudclose", [&] (lua::LuaState* state) {
state->pushinteger(hud->getPlayer()->getId());
return 1;
});