Snark Glitch Fix 1.15
1 Attachment(s)
This is a quick plugin for SvenCoop that fixes the snark glitch. I will not describe here how to USE the snark glitch, but I can say for sure
it has been fixed. However; I'm surprised this hasn't been done by anyone else yet. This bug in SvenCoop has been around since 3.0 and should be fixed when 3.5 comes out. As soon as 3.5 comes out this plugin will be not needed and I will pull it from AMXX. Commands: None CVARS: None Notes: a) I'm not sure how much resources this plugin would take up. It checks the users weapon quite frequently. b) Most of everything you see here was taken from: http://forums.alliedmods.net/showthread.php?t=41265 I just added the conditionals Version Notes: 1.00 : Initial Release 1.1 : Code optimization as per request. 1.15 : More optimization |
Re: Snark Glitch Fix
Hints:
1. It's possible to omit weapon index dynamical retrieval: Code:
2. It's possible to use a static variables declaration to increace performance especially in an intensive code areas. You migh be interested in review of the folowing article: http://wiki.amxmodx.org/index.php/Optimizing_Plugins 3. It's possible to use only fakemeta instead of fakemeta and engine. 4. It's possible to shorten the block of code Code:
Code:
|
Re: Snark Glitch Fix
Ok Its updated and I optimized the things you asked for. However I have to use engine for the following line:
entity_set_int(id, EV_INT_button, entity_get_int(id,EV_INT_button) & ~IN_ATTACK); Thanks for the input. |
Re: Snark Glitch Fix 1.1
Let me clear this up a bit. I didn't asked or requested for any changes or updates. It is just a useful information that may help you to improve your plugin if you interested.
Also a hint: there is nothing in engine that fakemeta can't do. And as i can see you misiterpreted the first hint. I didn't meant to hardcode the weapon index like that. You have to define the value like shown above and then use a defined marco constant when it's necessary. |
Re: Snark Glitch Fix 1.1
Quote:
http://www.amxmodx.org/funcwiki.php?..._int&go=search Says that entity_set_int is only in engine, also when I tried compiling without engine it sayed entity_set_int not found etc. I know I can just simply use the define included in the includes but I'd rather just use the hardcoded number. If we are talking optimization then it would save fractions of milliseconds. |
Re: Snark Glitch Fix 1.1
set_pev(id, pev_button, pev(id, pev_button) & ~IN_ATTACK)
|
Re: Snark Glitch Fix 1.1
Quote:
Here is how you would use that natives: Code:
I would highly not recommend to hardcode such common constants as weapon indeces. It is complicate reading of the code. You rather should define the constant once as shown above and then operating with the constant name, not the value itself. For example: if (MY_CONSTANT != something) // ... You should note that this will not affect the performance at all. |
Re: Snark Glitch Fix 1.1
OK, sounds great, I'll fix those things when I get home then. At work right now.
|
Re: Snark Glitch Fix 1.1
Quote:
This has been done before, a quick search of the plugins forum's would have told you so. http://forums.alliedmods.net/showthr...ighlight=snark Yes, I know its in the "Unapproved" section, but it was still done before this plugin, good luck on getting this Approved. |
Re: Snark Glitch Fix 1.1
Updated with more optimization as per request.
Quote:
|
All times are GMT -4. The time now is 04:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.