Skip to content

Commit

Permalink
Merge pull request #121 from mtxfellen/master
Browse files Browse the repository at this point in the history
Add bot check to $ForceRespawn inputs
  • Loading branch information
rafradek authored Sep 16, 2024
2 parents cd9cfa8 + 04b1868 commit 60bff60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mod/etc/mapentity_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ namespace Mod::Etc::Mapentity_Additions
}},
{"ForceRespawn"sv, false, [](CBaseEntity *ent, const char *szInputName, CBaseEntity *pActivator, CBaseEntity *pCaller, variant_t &Value){
CTFPlayer *player = ToTFPlayer(ent);
if (player != nullptr) {
if (player != nullptr && !player->IsBot()) {
if (player->GetTeamNumber() >= TF_TEAM_RED && player->GetPlayerClass() != nullptr && player->GetPlayerClass()->GetClassIndex() != TF_CLASS_UNDEFINED) {
player->ForceRespawn();
}
Expand All @@ -1007,7 +1007,7 @@ namespace Mod::Etc::Mapentity_Additions
}},
{"ForceRespawnDead"sv, false, [](CBaseEntity *ent, const char *szInputName, CBaseEntity *pActivator, CBaseEntity *pCaller, variant_t &Value){
CTFPlayer *player = ToTFPlayer(ent);
if (player != nullptr && !player->IsAlive()) {
if (player != nullptr && !player->IsBot() && !player->IsAlive()) {
if (player->GetTeamNumber() >= TF_TEAM_RED && player->GetPlayerClass() != nullptr && player->GetPlayerClass()->GetClassIndex() != TF_CLASS_UNDEFINED) {
player->ForceRespawn();
}
Expand Down

0 comments on commit 60bff60

Please sign in to comment.