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

Release your plugins here!
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

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

Postby iPlayer » Wed Jan 20, 2016 6:58 pm

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



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:



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.
Last edited by iPlayer on Tue Apr 25, 2017 10:40 am, edited 7 times in total.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 1606
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Jan 20, 2016 7:22 pm

Sweet! Small and simple. :)
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Wed Jan 20, 2016 7:28 pm

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?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 1606
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Jan 20, 2016 7:46 pm

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.
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Wed Jan 20, 2016 7:52 pm

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 :)
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2381
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Jan 21, 2016 4:03 am

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).
Image
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Thu Jan 21, 2016 4:13 am

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.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2381
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Jan 21, 2016 11:49 am

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.
Image
User avatar
Ayuto
Project Leader
Posts: 1606
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Thu Jan 21, 2016 3:24 pm

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.
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Thu Jan 21, 2016 3:34 pm

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.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 1606
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Thu Jan 21, 2016 3:44 pm

Well, now the the plugin will probably support all OrangeBox games.
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

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

Postby iPlayer » Tue Oct 25, 2016 9:11 pm

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
Last edited by L'In20Cible on Wed Oct 26, 2016 1:48 am, edited 1 time in total.
Reason: sp load → sp plugin load
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

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

Postby iPlayer » Thu Oct 27, 2016 5:20 pm

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
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
decompile
Senior Member
Posts: 318
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

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

Postby decompile » Mon Feb 20, 2017 1:23 am

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
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

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

Postby iPlayer » Tue Apr 25, 2017 9:19 am

Works fine for me on CS:GO.

What game and system?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
decompile
Senior Member
Posts: 318
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

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

Postby decompile » Mon May 01, 2017 8:54 pm

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.
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

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

Postby iPlayer » Tue May 02, 2017 10:01 am

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).
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
iPlayer
Developer
Posts: 522
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

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

Postby iPlayer » Sat May 06, 2017 8:53 pm

Replaced symbol with a signature on CS:GO Linux.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots

Hail, Companion. [...] Hands to yourself, sneak thief. Image

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 2 guests