Skip to content

Instantly share code, notes, and snippets.

@sigsegv-mvm
Created December 6, 2016 03:40
Show Gist options
  • Save sigsegv-mvm/236eebe275a6e3b9b24afe6b0d3a797d to your computer and use it in GitHub Desktop.
Save sigsegv-mvm/236eebe275a6e3b9b24afe6b0d3a797d to your computer and use it in GitHub Desktop.
// WTF WTF WTF WTF WTF
void CBaseObject::UpdateOnRemove()
{
// ...
this->DestroyObject();
if (TFGameRules() != nullptr && TFGameRules()->IsMannVsMachineMode() && this->GetTeamNumber() == TF_TEAM_BLUE) {
for (int i = 0; i < IBaseObjectAutoList::AutoList().Count(); ++i) {
CBaseObject *obj = static_cast<CBaseObject *>(IBaseObjectAutoList::AutoList()[i]);
if (obj == this) continue;
if (obj->GetType() == this->GetType()) {
if (!obj->IsDying() && obj->GetBuilder() == nullptr) {
obj->DetonateObject();
}
}
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment