Skip to content

Commit aea2675

Browse files
committed
fixes, add qf_australium_turntogold
1 parent e4bdd12 commit aea2675

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/game/server/tf/tf_player.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ ConVar sv_vote_late_join_cooldown( "sv_vote_late_join_cooldown", "300", FCVAR_NO
295295
#if defined(QUIVER_DLL)
296296
ConVar qf_tdm_spawnprotection("qf_tdm_spawnprotection", "1", FCVAR_NOTIFY, "");
297297
ConVar qf_tdm_spawnprotection_length("qf_tdm_spawnprotection_length", "4", FCVAR_NOTIFY, "");
298+
ConVar qf_australium_turntogold("qf_australium_turntogold", "1", FCVAR_NOTIFY, "");
298299
#endif
299300

300301
#ifdef BDSBASE
@@ -13661,7 +13662,7 @@ void CTFPlayer::Event_Killed( const CTakeDamageInfo &info )
1366113662
CALL_ATTRIB_HOOK_INT_ON_OTHER( pKillerWeapon, iGoldRagdoll, set_turn_to_gold );
1366213663

1366313664
#if defined(QUIVER_DLL)
13664-
if (iGoldRagdoll == 0)
13665+
if (qf_australium_turntogold.GetBool() && iGoldRagdoll == 0)
1366513666
{
1366613667
CALL_ATTRIB_HOOK_INT_ON_OTHER(pKillerWeapon, iGoldRagdoll, is_australium_item);
1366713668
}
@@ -16857,7 +16858,7 @@ void CTFPlayer::CreateFeignDeathRagdoll( const CTakeDamageInfo& info, bool bGib,
1685716858
CALL_ATTRIB_HOOK_INT_ON_OTHER( info.GetWeapon(), iGoldRagdoll, set_turn_to_gold );
1685816859

1685916860
#if defined(QUIVER_DLL)
16860-
if (iGoldRagdoll == 0)
16861+
if (qf_australium_turntogold.GetBool() && iGoldRagdoll == 0)
1686116862
{
1686216863
CALL_ATTRIB_HOOK_INT_ON_OTHER(info.GetWeapon(), iGoldRagdoll, is_australium_item);
1686316864
}

src/game/shared/tf/tf_weapon_lunchbox.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void CTFLunchBox::ApplyBiteEffects( CTFPlayer *pPlayer )
433433

434434
int iHealed = pPlayer->TakeHealth(iHeal, iHealType);
435435
// for bots, remove the sandvich to prevent it being eaten multiple times.
436-
if (iHealed > 0 && !pPlayer->IsBot())
436+
if (iHealed > 0)
437437
{
438438
CTF_GameStats.Event_PlayerHealedOther(pPlayer, iHealed);
439439
bDrainAmmo = true;
@@ -444,7 +444,7 @@ void CTFLunchBox::ApplyBiteEffects( CTFPlayer *pPlayer )
444444
{
445445
int maxPrimary = pPlayer->GetMaxAmmo(TF_AMMO_PRIMARY);
446446
int iAmmoGiven = pPlayer->GiveAmmo(maxPrimary * 0.25, TF_AMMO_PRIMARY, true);
447-
if (iAmmoGiven > 0 && !pPlayer->IsBot())
447+
if (iAmmoGiven > 0)
448448
{
449449
bDrainAmmo = true;
450450
}
@@ -458,14 +458,19 @@ void CTFLunchBox::ApplyBiteEffects( CTFPlayer *pPlayer )
458458
int maxArmor = pPlayer->GetMaxArmor();
459459
pPlayer->IncrementArmorValue(maxArmor * 0.25, maxArmor);
460460
int iArmorGiven = (pPlayer->ArmorValue() - oldArmor);
461-
if (iArmorGiven > 0 && !pPlayer->IsBot())
461+
if (iArmorGiven > 0)
462462
{
463463
bDrainAmmo = true;
464464
}
465465
}
466466
#endif
467467
}
468468

469+
if (pPlayer->IsBot() || pPlayer->IsFakeClient())
470+
{
471+
bDrainAmmo = false;
472+
}
473+
469474
// Drain ammo on the first bite that applied an effect
470475
if (bDrainAmmo && !pPlayer->m_Shared.m_bBiteEffectWasApplied)
471476
{

0 commit comments

Comments
 (0)