Raised This Month: $51 Target: $400
 12% 

Linux func_rotating bug fixer


Post New Thread Reply   
 
Thread Tools Display Modes
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 11-15-2008 , 19:21   Re: Linux func_rotating bug fixer
Reply With Quote #21

Wouldn't it be more correct to use:

PHP Code:
while( fAngle[0]>180.0 )
    
fAngle[0] -= 360.0;

while( 
fAngle[0]<=-180.0 )
    
fAngle[0] += 360.0;

while( 
fAngle[1]>180.0 )
    
fAngle[1] -= 360.0;

while( 
fAngle[1]<=-180.0 )
    
fAngle[1] += 360.0;

while( 
fAngle[2]>180.0 )
    
fAngle[2] -= 360.0;

while( 
fAngle[2]<=-180.0 )
    
fAngle[2] += 360.0
???
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Russiaboy
BANNED
Join Date: May 2009
Location: ZombiePlague is my Home
Old 06-13-2009 , 07:32   Re: Linux func_rotating bug fixer
Reply With Quote #22

Work it with heroes (SuperHeroMod)

some heroes don't get in Linux..
Russiaboy is offline
Send a message via MSN to Russiaboy Send a message via Skype™ to Russiaboy
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-25-2009 , 16:22   Re: Linux func_rotating bug fixer
Reply With Quote #23

Found that thos entities stop rotation (only visual) when some angle value is above 32768 or below -32768 on linux, and -16777216/16777216 (=32768*512) on windows, at least on my computer and on my dediacted server.

Here a better coded (i hope) plugin.

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    func_rotating  bugfix is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with func_rotating  bugfix; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.2"

public plugin_init()
{
    
register_plugin("func_rotating bugfix"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Think"func_rotating""Think_FixAngles"1)
    
RegisterHam(Ham_Think"func_train""Think_FixAngles"1)
}

public 
Think_FixAnglesiEnt )
{
    new 
Float:vecAngles[3], bSetiFloat:fAngle

    pev
(iEntpev_anglesvecAngles)
    
bSet false

    
for(i=0i<3i++)
    {
        
fAngle vecAngles[i]
        if( 
fAngle < -360.0 || fAngle 360.0 )
        {
            
vecAngles[i] -= floatround(fAngle) / 360 360
            bSet 
true
        
}
    }

    if( 
bSet )
    {
        
set_pev(iEntpev_anglesvecAngles)
    }

Attached Files
File Type: sma Get Plugin or Get Source (func_rotating_bugfix.sma - 822 views - 1.4 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-20-2010 at 13:17.
ConnorMcLeod is offline
Old 03-31-2010, 15:18
xPaw
This message has been deleted by xPaw. Reason: Look up for connor's plugin :-)
pizzahut
Senior Member
Join Date: Oct 2004
Old 07-18-2010 , 07:18   Re: Linux func_rotating bug fixer
Reply With Quote #24

Shouldn't this be floatround(fAngle / 360) * 360 ?

Edit: Today (2010-09-21) I wrote a plugin to test this and ConnorMcLeod's formula works just fine.
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.

Last edited by pizzahut; 09-21-2010 at 09:09.
pizzahut is offline
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-20-2010 , 12:32   Re: Linux func_rotating bug fixer
Reply With Quote #25

And what the code is correct? That's what he said pizzahut true or not?
__________________
AlexALX is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-20-2010 , 13:08   Re: Linux func_rotating bug fixer
Reply With Quote #26

floatround(fAngle) / 360 * 360

This is correct.


If you want you can put :

(floatround(fAngle) / 360) * 360

But i guess the result is the same.

Idea is to make something like modulo but with float, so if you have 325.2, substract 320 to keep 5.2, if you have 735.3, keep 15.3 etc...


Plugin updated with fun_train + Ham_Think
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-20-2010 at 13:17.
ConnorMcLeod is offline
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-20-2010 , 13:17   Re: Linux func_rotating bug fixer
Reply With Quote #27

What code to best use? xPaw or the original (first post)?
__________________
AlexALX is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-20-2010 , 13:26   Re: Linux func_rotating bug fixer
Reply With Quote #28

Quote:
Originally Posted by AlexALX View Post
What code to best use? xPaw or the original (first post)?
Connor's.
__________________
xPaw is offline
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-20-2010 , 14:42   Re: Linux func_rotating bug fixer
Reply With Quote #29

Eeee .... Did this fix not only for Linux? oO
__________________
AlexALX is offline
Old 09-20-2010, 17:51
AlexALX
This message has been deleted by AlexALX.
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-21-2010 , 17:34   Re: Linux func_rotating bug fixer
Reply With Quote #30

Can I build this plug-in to my [DeathRun] Triggers & Entities Fix? (Ask the author as if ... ConnorMcLeod) And if I build it - then do the checking on Linux or not? (Do fix only for Linux servers)
__________________
AlexALX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode