Skip to content

[TF2] Improve ammo display on target ID #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

horiuchii
Copy link

Description

This PR makes multiple changes to how ammo displays on the TargetID Display, which appears when healing a patient.

  1. Ammo count no longer displays on weapons without ammo
  2. Reserve ammo shows up next to the clip ammo when available

These changes also apply to spy's disguises and two new VScript functions GetDisguiseAmmoReserveCount() and SetDisguiseAmmoReserveCount() have been added to access the disguise reserve ammo.
Similarly to how ammo appears for disguise weapons, the reserve is also randomized when viewed this way.

If this gets merged, a new language token needs to be added to show weapons with reserve ammo:
"TF_playerid_ammo_reserve" " %s1 / %s2"

Ammo no longer displays on weapons without ammo
Reserve ammo shows up when applicable
@@ -747,43 +747,45 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
void ScriptSetCondDuration( int nCond, float flNewDuration );
HSCRIPT ScriptGetDisguiseTarget();

bool ScriptIsCarryingRune() { return m_Shared.IsCarryingRune(); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just whitespace changes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an additional tab spacing past the function declaration to make it look uniform with the two new functions I added, in hindsight this with probably unnecessary and creates confusion when trying to diff this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants