[ScriptError]: Improve speed since patch number is known (#816)

This commit is contained in:
Edo 2023-03-07 18:39:55 +00:00 committed by GitHub
parent 2ad42c2052
commit cf83c6d315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -873,6 +873,8 @@ namespace Components::GSC
{ {
#ifdef SCRIPT_ERROR_PATCH #ifdef SCRIPT_ERROR_PATCH
std::vector<std::pair<std::size_t, void*>> patches; std::vector<std::pair<std::size_t, void*>> patches;
patches.resize(200);
const auto p = [&patches](const std::size_t a, void* b) const auto p = [&patches](const std::size_t a, void* b)
{ {
patches.emplace_back(a, b); patches.emplace_back(a, b);

View File

@ -105,10 +105,12 @@ namespace Components
{ {
return false; return false;
} }
if (ent1->client->sess.cs.team) if (ent1->client->sess.cs.team)
{ {
return ent1->client->sess.cs.team == ent2->client->sess.cs.team; return ent1->client->sess.cs.team == ent2->client->sess.cs.team;
} }
return false; return false;
} }