fix: breakable headache (ref #660)

fix: bots firing rates on short distances (ref #658)
This commit is contained in:
jeefo 2025-01-14 14:17:53 +03:00
commit c07d02c14e
No known key found for this signature in database
GPG key ID: D696786B81B667C8
9 changed files with 157 additions and 53 deletions

View file

@ -62,6 +62,7 @@ void Game::levelInitialize (edict_t *entities, int max) {
// clear all breakables before initialization
m_breakables.clear ();
m_checkedBreakables.clear ();
// initialize all config files
conf.loadConfigs ();
@ -154,7 +155,10 @@ void Game::levelInitialize (edict_t *entities, int max) {
else if (classname.startsWith ("func_button")) {
m_mapFlags |= MapFlags::HasButtons;
}
else if (util.isShootableBreakable (ent)) {
else if (util.isBreakableEntity (ent, true)) {
// add breakable for material check
m_checkedBreakables[indexOfEntity (ent)] = ent->v.impulse <= 0;
m_breakables.push (ent);
}
}
@ -1229,6 +1233,10 @@ edict_t *Game::createFakeClient (StringRef name) {
return ent;
}
void Game::markBreakableAsInvalid (edict_t *ent) {
m_checkedBreakables[indexOfEntity (ent)] = false;
}
void LightMeasure::initializeLightstyles () {
// this function initializes lighting information...