Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficerSpy committed Dec 21, 2024
1 parent 9510494 commit 73ee3da
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions source/bwree/dhooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ static MRESReturn DHookCallback_PassesFilterImp1_Pre(int pThis, DHookReturn hRet
{
int entity = hParams.Get(2); //The entity being filtered

//Only want to check players
if (entity > MaxClients)
return MRES_Ignored;

//Must be a robot player
if (!IsPlayingAsRobot(entity))
return MRES_Ignored;
Expand Down
19 changes: 11 additions & 8 deletions source/bwree/robot_templates.sp
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,13 @@ static Action Timer_FinishRobotPlayer(Handle timer, DataPack pack)
//Standard shit i guess
PostInventoryApplication(client);

/* NOTE: CTFBotSpawner::Spawn actually checks CTFPlayer::IsMiniBoss
but I'd rather just check our attribute array than the actual property */
if (roboPlayer.HasAttribute(CTFBot_MINIBOSS))
{
MultiplayRules_HaveAllPlayersSpeakConceptIfAllowed(MP_CONCEPT_MVM_GIANT_CALLOUT, view_as<int>(TFTeam_Red));
}

bool bAddedClassIconToWavebar = false;

if (nMission == CTFBot_MISSION_DESTROY_SENTRIES)
Expand Down Expand Up @@ -866,10 +873,6 @@ static Action Timer_FinishRobotPlayer(Handle timer, DataPack pack)
if (nSniperCount == 1)
MultiplayRules_HaveAllPlayersSpeakConceptIfAllowed(MP_CONCEPT_MVM_SNIPER_CALLOUT, view_as<int>(TFTeam_Red));
}
else if (roboPlayer.HasAttribute(CTFBot_MINIBOSS))
{
MultiplayRules_HaveAllPlayersSpeakConceptIfAllowed(MP_CONCEPT_MVM_GIANT_CALLOUT, view_as<int>(TFTeam_Red));
}

if (nMission >= CTFBot_MISSION_SNIPER && nMission <= CTFBot_MISSION_ENGINEER)
{
Expand Down Expand Up @@ -1180,19 +1183,19 @@ DifficultyType GetSkillFromString(const char[] value)
{
if (strlen(value) > 0)
{
if (!strcmp(value, "Easy"))
if (!strcmp(value, "Easy", false))
{
return CTFBot_EASY;
}
else if (!strcmp(value, "Normal"))
else if (!strcmp(value, "Normal", false))
{
return CTFBot_NORMAL;
}
else if (!strcmp(value, "Hard"))
else if (!strcmp(value, "Hard", false))
{
return CTFBot_HARD;
}
else if (!strcmp(value, "Expert"))
else if (!strcmp(value, "Expert", false))
{
return CTFBot_EXPERT;
}
Expand Down
8 changes: 3 additions & 5 deletions source/tf2_bwree.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ public void TF2_OnConditionAdded(int client, TFCond condition)
m_bBypassBotCheck[client] = false;

//Particle is handled client-side and only shows up on bots, so just do this
EmitParticleEffect("bot_radio_waves", "head", client, PATTACH_POINT_FOLLOW);
// EmitParticleEffect("bot_radio_waves", "head", client, PATTACH_POINT_FOLLOW);
}
}

Expand All @@ -1660,7 +1660,7 @@ public void TF2_OnConditionRemoved(int client, TFCond condition)
else if (condition == TFCond_MVMBotRadiowave)
{
//Stop the particle we may have added earlier in TF2_OnConditionAdded
StopParticleEffects(client);
// StopParticleEffects(client);
}
}

Expand Down Expand Up @@ -2214,9 +2214,7 @@ public Action Actor_OnTakeDamage(int victim, int &attacker, int &inflictor, floa
if (GameRules_GetRoundState() == RoundState_BetweenRounds && BaseEntity_GetTeamNumber(victim) != GetClientTeam(attacker))
{
//Can't damage anyone between rounds
damage = 0.0;

return Plugin_Changed;
return Plugin_Handled;
}

if (MvMRobotPlayer(attacker).HasAttribute(CTFBot_ALWAYS_CRIT))
Expand Down

0 comments on commit 73ee3da

Please sign in to comment.