Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
add stop blood api
Browse files Browse the repository at this point in the history
  • Loading branch information
huoji120 committed Oct 21, 2023
1 parent 31a3fe5 commit d3f22fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions csgo2/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions csgo2/script_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit d3f22fc

Please sign in to comment.