bot: benefit from sse4.x intrinsics if cpu capable

bot: speed some string functions if sse 4.x available
build: allow to build with native optimizations by settings -Dnative=true
This commit is contained in:
jeefo 2023-06-09 06:27:04 +03:00
commit 0b8cd9a01c
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
18 changed files with 133 additions and 89 deletions

View file

@ -1438,7 +1438,7 @@ void Bot::pickupItem_ () {
auto &info = conf.getWeapons ();
for (index = 0; index < 7; ++index) {
if (strcmp (info[index].model, m_pickupItem->v.model.chars (9)) == 0) {
if (cr::strcmp (info[index].model, m_pickupItem->v.model.chars (9)) == 0) {
break;
}
}
@ -1562,7 +1562,7 @@ void Bot::pickupItem_ () {
game.searchEntities (pev->origin, 768.0f, [&] (edict_t *ent) {
auto classname = ent->v.classname.chars ();
if (strncmp ("hostage_entity", classname, 14) != 0 && strncmp ("monster_scientist", classname, 17) != 0) {
if (cr::strncmp ("hostage_entity", classname, 14) != 0 && cr::strncmp ("monster_scientist", classname, 17) != 0) {
return EntitySearchResult::Continue;
}