Skip to content
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

Non-stock weapons (such as TFA weapons) do not render their base viewmodels #1432

Closed
nike4613 opened this issue Feb 25, 2024 · 6 comments · Fixed by #1442
Closed

Non-stock weapons (such as TFA weapons) do not render their base viewmodels #1432

nike4613 opened this issue Feb 25, 2024 · 6 comments · Fixed by #1442
Labels
type/bug Something isn't working
Milestone

Comments

@nike4613
Copy link
Contributor

Your version of TTT2 (mandatory)

v0.13.0b (both workshop and git)

Describe the bug (mandatory)

Non-stock weapons do not render their base viewmodels by default. This appears to be due to #1342 being opt-in to rendering the base viewmodel rather than opt-out. Any weapons which are not aware of this property will not render correctly.

This can be fairly simply fixed by setting that property to true on any weapon which does not have it set.

To reproduce

Steps to reproduce the behaviour:

  1. Install some custom weaponry
  2. Enable it in TTT (through whatever means)
  3. Pick up that weapon

Expected behaviour

The viewmodels render.

Context (please provide as much as you can)

Mostly the same as #1411.

Screenshots

image

@TimGoll
Copy link
Member

TimGoll commented Feb 25, 2024

It is not opt-in though. If the weapon is based on the TTT2 base, the value is automatically set to true:

https://github.com/TTT-2/TTT2/blob/master/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua#L94

So I guess TFA doesn't use the TTT2 weapon base?

@nike4613
Copy link
Contributor Author

Yes, that is correct. TFA does implement a number of methods that are required for TTT weapons though. I would expect that this property either default-true if type(tbl.ShowDefaultViewModel) == "nil", or that the render prevention be disabled for non TTT-derived weapons.

@Histalek
Copy link
Member

IMO we should definitely prevent this unexpected breakage; unexpected because TFA weapons don't do hacky render stuff with the Viewmodel.

I would be fine with default-true in the nil case. Given that the idea was to give weapons an easy way to prevent the rendering of the default viewmodel.

I don't think we should cripple weapons that go out of their way to have TTT compatibility while not using the weapon_tttbase for whatever reason.

WDYT @TimGoll ?

@TimGoll
Copy link
Member

TimGoll commented Feb 26, 2024

I can prevent this issue by explictily checking for false instead of if not xyz. I think that is the best solution here

@Histalek Histalek added this to the v0.13.1b milestone Feb 26, 2024
TimGoll added a commit that referenced this issue Feb 26, 2024
…base (#1442)

Fixes #1432 

If a weapon is not based on the weapon base, `ShowDefaultWorldModel` is
`nil`. In this case the viwe model should be rendered as well. We
therefore check for an explicit `false` instead.

---------

Co-authored-by: Histalek <16392835+Histalek@users.noreply.github.com>
@nike4613
Copy link
Contributor Author

Can confirm, 0e8e177 fixes this issue.

@TimGoll
Copy link
Member

TimGoll commented Feb 27, 2024

Can confirm, 0e8e177 fixes this issue.

Awesome, thanks for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants