Author Topic: Holdtype and Headshot bug  (Read 1644 times)

0 Members and 1 Guest are viewing this topic.

Offline Doomed

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Holdtype and Headshot bug
« on: June 18, 2017, 07:55:47 PM »
In my gamemode, there is this weird, inconsistent bug where players will sometimes hold their weapons like a pistol and will not take headshot damage. When they join they are given weapons based on what class they are. I spawned a few bots, and it seems as though there is a 50/50 chance of this glitch affecting them. Also, yes I did set each SWEP's hold type in their shared files. Is there any explanation for this?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Holdtype and Headshot bug
« Reply #1 on: June 18, 2017, 08:47:48 PM »
Without seeing all the gamemode code (which, honestly, many of us don't have time for), it's really difficult to tell from your description.
We might as well flip a coin while guessing.

My coin toss...
You have spawn loadout code twice - one normal, one custom.
Both get executed, 50 50 chance of either one executing last.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Doomed

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Re: Holdtype and Headshot bug
« Reply #2 on: June 18, 2017, 09:12:15 PM »
EDIT: Fixed, just had to change the setholdtype function
« Last Edit: June 19, 2017, 03:47:30 PM by Doomed »