RafaelDeJongh/cap

Stargate on Slow Dial (SGC Dial) does not work properly on lower Tickspeeds

Closed this issue · 4 comments

I reduced the tickspeed on my server to 33, because it has to handle a lot of player. (RP-Server)
Then i noticed that it does not dial correctly (Sometimes it needs more than one revolution to actually find a glyph.
This happens because the range that it detects the glyphs is very slim.

What i did is just add this into the top of the "ENT:StopFormula(y,x,n,n2)" function:

-- Adjusting ranges to actually be big enough so it works with the set Tickrate.
local tickRateRelation = 66.666668156783 / (1 / engine.TickInterval())
local inBetween = (n + n2) / 2
local diff = (n - n2) * tickRateRelation
n = inBetween + diff
n2 = inBetween - diff

Seems to work perfectly, but i don't have the time test it properly for some time. If you guys want me to create a pull request it's fine but there's probably a better way to do this.

It might lost some accuracy but as long that works - its fine, i'll merge soon when will prepare update. Thanks

It did already factor in a bit inaccuracy. I just adjusted those areas of inaccuracy to scale with the tickspeed

please help when i try to dail a gate with the dailcomputer then it takes like 10 minutes till it startes dailing