This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[Fixed] Too much XP resets to negative number


  
 
 
Thread Tools Display Modes
Author Message
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 04-20-2005 , 22:15   [Fixed] Too much XP resets to negative number
#1

Tested on:
Windows XP
Amxmodx 1.01
Metamod 1.17.4
SuperHero Mod 1.18CVS
Vault Saving


Regaurdless of my tests specs, this will happen on all amx/x and shmod versions.

Bug:
If a user is to surpass 2147483647xp, their xp will be changed to a negative number starting from -2147483648 and they will lose all their levels. A check is needed to limit xp gain to no more then 2147483647xp. Because that is the integer limit Small can handle.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
Tassadarmaster
BANNED
Join Date: Aug 2004
Location: California
Old 04-21-2005 , 00:59  
#2

how do you fix that?
Tassadarmaster is offline
Send a message via ICQ to Tassadarmaster Send a message via AIM to Tassadarmaster Send a message via MSN to Tassadarmaster Send a message via Yahoo to Tassadarmaster
guy
Senior Member
Join Date: Apr 2005
Old 04-21-2005 , 01:18  
#3

im just wondering whos server has THAT much xp
2 billion honestly.
and if some of their kill xp is like 10k they should divide everything by two or something.
did someone confront you with this bug or were you just testing?
guy is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 04-21-2005 , 12:41  
#4

Quote:
Originally Posted by guy
im just wondering whos server has THAT much xp
you'd be suprised...

This came about because of this post where Iconoclast set his level ammounts too high... (his max was 24,879,640,000... and you thought 2 billion was excessive)
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
guy
Senior Member
Join Date: Apr 2005
Old 04-21-2005 , 13:09  
#5


jesus do people even level on his server?!
also is there any specific reason that its that integer that small cant handle it or was it just random?
*curious george*
new shmod server people should be aware of this until its fixed.
im so surprised because i played on a 60 lvls server and the lvl 60's only went up to 10 mill...
edit
thats crazy.
the more you know
guy is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 04-21-2005 , 14:00  
#6

It's a Mersenne prime that is used in for 32 bit coding languages for signed integers (signed meaning + -). because code is binary 2 numbers, 2^#

Quote:
M31 = 2^31 - 1 = 0x7FFFFFFF. It also happens to be the largest signed 32-bit integer (available in many programing languages, i.e., C/C++ int on 32-bit platforms).
Quote:
most computers use 32 "bits" to store integer numbers. The largest number you can fit inside 32 bits is 4,294,967,295. However, in order to have "signed" integers (which means that you can have negative numbers) you need to give up one of those bits. So you really only have 31 bits to store your numbers. The largest number you can fit inside 31 bits is 2,147,483,647.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 05-03-2005 , 21:05  
#7

fixed in CVS
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
 



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 21:05.


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