Skip to content

Conversation

@mexikoedi
Copy link
Contributor

This PR fixes the following error:

[TTT2 (Base) - v0.14.5b] gamemodes/terrortown/gamemode/server/sv_player.lua:1113: attempt to call method 'GetHeadshotMultiplier' (a nil value)
  1. unknown - gamemodes/terrortown/gamemode/server/sv_player.lua:1113

The error appeared on this map: [TTT] ttt_terminus_v1

If you are a Traitor you can call combine policemen.
Some of them have pistols and these are not compatible with TTT/TTT2.
You get this error if you try to pick up the pistol:

[TTT2 (Base) - v0.14.5b] Equipped weapon weapon_pistol is not compatible with TTT
  1. unknown - gamemodes/terrortown/gamemode/server/sv_weaponry.lua:529

This is correct because you shouldn't be able to pick up weapons which aren't compatible.

But if they hit you in the head with the pistol it causes the above GetHeadshotMultiplier error which shouldn't happen.

I tested this PR and the combine policemen didn't cause this error anymore if the hit the head of a player.

Copy link
Member

@saibotk saibotk left a comment

Choose a reason for hiding this comment

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

Thanka for the fix that looks reasonable

@saibotk saibotk merged commit 0e2a72a into TTT-2:master Nov 24, 2025
4 checks passed
@mexikoedi mexikoedi deleted the getheadshotmultiplier-fix branch November 24, 2025 13:14
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