diff --git a/csgo2/hooks.cpp b/csgo2/hooks.cpp index 6d39b8c..3ff6fd5 100644 --- a/csgo2/hooks.cpp +++ b/csgo2/hooks.cpp @@ -45,13 +45,14 @@ void __fastcall hook_PostEventAbstract( if (isBloodAboutMessage == false/* && isWeaponAboutMessage == false */) { break; } - for (uint64 i = 0; i < global::MaxPlayers; i++) + // lazy fix me + for (uint64_t i = 0; i < global::MaxPlayers; i++) { - if (!(*(uint64*)clients & ((uint64)1 << i))) { + if (!(*(uint64_t*)clients & ((uint64_t)1 << i))) { continue; } - const auto pEntity = global::EntitySystem->GetBaseEntity(i); + const auto pEntity = global::EntitySystem->GetBaseEntity(PlayerSlot_to_EntityIndex(i)); if (pEntity == nullptr) { continue; } diff --git a/csgo2/script_callbacks.cpp b/csgo2/script_callbacks.cpp index d1ee986..689632d 100644 --- a/csgo2/script_callbacks.cpp +++ b/csgo2/script_callbacks.cpp @@ -131,7 +131,7 @@ auto luaCall_onPlayerSpeak(int speaker, int chatType, std::string message) lua_tostring(luaVm, -1)); lua_pop(luaVm, 1); } - if (lua_isboolean(luaVm, -1)) { + if (lua_isboolean(luaVm, -1) && result == false) { result = lua_toboolean(luaVm, -1); } } @@ -231,7 +231,7 @@ auto luaCall_onPlayerTeamChange(int userid, int team, int oldteam, lua_tostring(luaVm, -1)); lua_pop(luaVm, 1); } - if (lua_isboolean(luaVm, -1)) { + if (lua_isboolean(luaVm, -1) && result == false) { result = lua_toboolean(luaVm, -1); } } @@ -279,7 +279,7 @@ auto luCall_onSayText2Filter(int player, uint64_t eMessageType, lua_tostring(luaVm, -1)); lua_pop(luaVm, 1); } - if (lua_isboolean(luaVm, -1)) { + if (lua_isboolean(luaVm, -1) && result == false) { result = lua_toboolean(luaVm, -1); } }