Page 1 of 1

[CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Wed Jan 20, 2016 6:58 pm
by iPlayer
[CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

http://pastebin.com/Jhs9ALnn


Hey there,

I'm sure some of you encountered such spam in your console
Bad SetLocalAngles(<some big numbers here>) on func_rotating
(maybe instead of 'func_rotating' you see entity targetname)

Not only does this spam your console, but the guilty func_rotating also stops working. In case of cs_assault, the fans in vents stop rotating. While it's not critical on cs_assault (besides spamming), some minigames or other custom maps can rely on func_rotating's very heavily.

This bug happens when func_rotating rotates for too long but the bug resets with the round start. But the faster entity rotates, the sooner this glitch will happen.

So I decided to fix it. Not just suppress the warning spam, but to fix the bug itself.

Here's the script:

(download)


Save it <mod dir>/addons/source-python/plugins/badlocalanglesfix/badlocalanglesfix.py and add the following line to your autoexec.cfg:

Code: Select all

sp plugin load badlocalanglesfix


Tested on
  • Windows CS:S server
  • Windows CS:GO server

Not tested on
  • Linux CS:S server
  • Linux CS:GO server
  • Linux/Windows TF2 server - need feedback
  • Other OB games

Cheers.

Posted: Wed Jan 20, 2016 7:22 pm
by Ayuto
Sweet! Small and simple. :)

Posted: Wed Jan 20, 2016 7:28 pm
by iPlayer
Thanks, Ayuto. Yep, but Windows signature is too broad (too many '2A'-s), I guess it can be shortened.
For now I just skip the whole commands that include pointers. I know pointers are 4 bytes long but still... Number of opcode varies for different commands, so the best I can do is to mask the whole line out.
Any chance on getting Signature Scanning #2?

Posted: Wed Jan 20, 2016 7:46 pm
by Ayuto
I can't remember if I mentioned that, but there is a nice script you can use to create the signature.
https://github.com/alliedmodders/sourcemod/blob/master/tools/ida_scripts/makesig.idc

You can also try these scripts I made to automatically discover a few Windows functions:
https://github.com/Ayuto/discover_win

It's implementing two very simple search mechanisms to find the Windows functions. If I remember correctly it's able to find ~2000 functions in the server.dll. Note, it might take quite long to finish. :D

Currently, I don't plan to create a Signature Scanning #2 video.

Posted: Wed Jan 20, 2016 7:52 pm
by iPlayer
Yep, you mentioned that, but, you know, I don't want to use such scripts sooner than I can do these things manually.

Thanks for your discover_win, I'll try to get its logic.

Okay then, thanks for the first video anyway. By the way, I didn't even know it was yours, just found on the internet. Then I saw it was about SPE, plus you were speaking German, and it turned out to be yours :)

Posted: Thu Jan 21, 2016 4:03 am
by satoon101
I did notice that SetLocalAngles is an Input for CBaseEntity in CS:GO. That would be more easily maintained than a signature if it still works as intended for you. We could easily add that to the data so that all one would have to do is use a normal EntityPreHook using the attribute name we give it as the second argument (likely set_local_angles).

Posted: Thu Jan 21, 2016 4:13 am
by iPlayer
I don't think it's implemented for CS:S though. And I'm not sure this bug is present in CS:GO at all, because that's the game that they actually care about.
However, even if the input was a thing in CS:S, I believe func_rotating wouldn't fire it during rotation. Because rotation happens like every tick, firing an input with all checks would create an overhead, plus it's rather an internal thing.


Talking about maintaining - I guess whenever the signature for SetLocalAngles changes, it's because they decided to fix the bug themselves.

Posted: Thu Jan 21, 2016 11:49 am
by satoon101
Sorry, for some reason I was thinking this was a CS:GO issue not CS:S.

And if the signature does change, that doesn't necessarily mean they fixed it. This is Valve we are talking about.

Posted: Thu Jan 21, 2016 3:24 pm
by Ayuto
I have noticed that you have updated the title with the [OrangeBox] tag. Currently, your plugin supports only CS:S, because of this line:

Syntax: Select all

server = find_binary('cstrike/bin/server')
Just change it to this one:

Syntax: Select all

server = find_binary('server')


Edit:

Oh, and signatures can also change if the compiler flags have been changed.

Posted: Thu Jan 21, 2016 3:34 pm
by iPlayer
Oh, I see. I guess I'll change the library to 'server' then but will also replace [OrangeBox] with [CS:S] tag. Although it'd be nice if this worked for TF2, too. I'll try to find TF2 signatures.

Edit: TF2 signature seems to match the one from CS:S. Not sure if it's unique in TF2, will need some testing. But I guess I'll add TF2 tag to the title.

Posted: Thu Jan 21, 2016 3:44 pm
by Ayuto
Well, now the the plugin will probably support all OrangeBox games.

Re: [OrangeBox] Bad SetLocalAngles(...) fix

Posted: Tue Oct 25, 2016 9:11 pm
by iPlayer
Updated to support Counter-Strike: Global Offensive

Here's the script http://pastebin.com/Jhs9ALnn (download)

Save it <mod dir>/addons/source-python/plugins/badlocalanglesfix/badlocalanglesfix.py and add the following line to your autoexec.cfg:

Code: Select all

sp plugin load badlocalanglesfix

Re: [CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Thu Oct 27, 2016 5:20 pm
by iPlayer
Fixed the bug causing entities to rotate only in positive angular direction

Here's the script http://pastebin.com/Jhs9ALnn (download)

Save it <mod dir>/addons/source-python/plugins/badlocalanglesfix/badlocalanglesfix.py and add the following line to your autoexec.cfg:

Code: Select all

sp plugin load badlocalanglesfix

Re: [CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Mon Feb 20, 2017 1:23 am
by decompile
Heads up:

Code: Select all

[SP] Loading plugin 'badlocalanglesfix'...

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/command.py", line 162, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 193, in load
    plugin._load()
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "../addons/source-python/plugins/badlocalanglesfix/badlocalanglesfix.py", line 17, in <module>
    server = find_binary('server')

OSError: Unable to find ../bin/server_srv.so

Re: [CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Tue Apr 25, 2017 9:19 am
by iPlayer
Works fine for me on CS:GO.

What game and system?

Re: [CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Mon May 01, 2017 8:54 pm
by decompile
Sorry for the late answer.

Im not 100% sure anymore, but I think it was CS:GO & Linux. (I loaded it up with autoexec.cfg).

CS:GO Windows works confirmed.

Re: [CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Tue May 02, 2017 10:01 am
by iPlayer
Ah. Got it. CS:GO on linux doesn't have server_srv.so like other games, it's just server.so.

I've disabled _srv suffix check for CS:GO, should work fine now (if the signatures are still up to the date).

Re: [CS:GO/OrangeBox] Bad SetLocalAngles(...) fix

Posted: Sat May 06, 2017 8:53 pm
by iPlayer
Replaced symbol with a signature on CS:GO Linux.