TTT-2 / ttt2-deathgrip

0 stars 1 forks source link

Deathgrip convars not working #6

Closed Pustekuchen98 closed 4 years ago

Pustekuchen98 commented 4 years ago

Your version of TTT2 (mandatory)

Describe the bug (mandatory)

Convars of the deathgrip role are not working at all. Namely "ttt2_deathgrip_chance" and "ttt2_deathgrip_reset_min_players".

Expected behaviour

Changing the deathgrip spawn chance + the minimum player count for the deathgrip to be removed.

Context (please provide as much as you can)

Additional context

Add any other context about the problem here.

tomatosoupcan commented 4 years ago

Is this because math.random(0,1) will only return 0 or 1? Going to test that myself tonight.

tomatosoupcan commented 4 years ago

Update: yes, I tested this myself. Should be using math.random(0,100)/100 instead, or simply math.random() I believe.

Pustekuchen98 commented 4 years ago

The issue you are talking about was fixed with the last commit about 1 month ago. I just couldn't close the issue because the problem with the 'min player deathgrip' reset still exists.

TimGoll commented 4 years ago

I have some time right now, I'll test it

TimGoll commented 4 years ago

fixed in dev

tomatosoupcan commented 4 years ago

As far as I can tell, math.random(0,1) will still always return a full integer value of 0 or 1, making the odds remain 50/50. Maybe my gmod executes this code differently than others somehow. I was logging the output to chat last night and restarting the round and never saw anything other than 0 or 1 come up.

TimGoll commented 4 years ago

Pustekuchen said that it was fixed so I did not bother checking it

TimGoll commented 4 years ago

I changed it to math.Rand, it should work now

Pustekuchen98 commented 4 years ago

It did work on my server after my commit. So thats why I said it is fixed. And I never experienced 50/50 odds after that. That is strange.