I need to fix this folks
This Code is stock :
Code:
// Note: The client calculates exp separately, we cant change this function Please Help ! I want to go with what you guys wrote and not some weirdness but it seems my database is stuck on it's old ways.. Is there some way I can repair this issue? At the top it says Quote:
Morty |
I know i'm a total n00b by the way and please forgive me devs for even allowing my change to go in in the first place..
I have changed the code to this for now, and it seems to have fixed my problem however I still desire a vender recommended solution please :) Code:
// Note: The client calculates exp separately, we cant change this function |
I suggest checking if the value returned by GetEXPForLevel is being cast to a signed int anywhere. 3000(98^3) would be wrapping if that is the case (where going from lvl 99 to 100).
|
Look dude, I don't speak dev that's why I've never posted in here :) Can you please send that in English? Love ya guys!
|
Quote:
|
Yes I understand I "FAIL" because that is why I posted this so that I can get help with this and not "FAIL" ..
Please help me to understand how I can check the value returned by "GetEXPForLevel" ?? |
You are the least technical network whatever you claim to be. Its basic stuff like this that undermines all the boasting you do lol.
Lets break this down... Your code: Code:
else if (check_level < 101) Code:
float base = (check_levelm1)*(check_levelm1)*(check_levelm1); check_levelm1 = 100 <-- Character level(lets test max) mod = 3.0 <-- This is the modifier a level 100 char has base = 100 * 100 * 100 = 1,000,000 mod = 3.0 * 1000 = 3,000 return val = 1,000,000, * 3,000 = 3,000,000,000 The max value a uint32 can hold is ~2.14 billion. A monkey could figure out where to go from here... good luck. |
The maximum value of a uint32 is 4,294,967,295. It's possible that is it being converted to a signed value somewhere along the way which would make anything over 2,147,483,647 become negative.
|
Thanks guys for explaining this. I didn't have the patience yesterday.
|
Quote:
Quote:
|
Mort, dude, didn't you just hire a 'brilliant' coder? Why couldn't he fix it? "Brilliant" and "better than me" are two different things, just saying. You've been doing this for 10 years, you should be able to speak in fluent C++ by now.
|
i don't see coding there except the maximum value a uint32 can hold (could google for that... just saying...)
it really is basic math... sorry mort but i kinda have to agree on this one... that was pretty simple... |
I had a go at expressing the exp curve as a single (mathematical) function. With those strange coefficients I think you could only get a pretty rough approximation because of the relatively large numbers being used.
To Mort: Try setting a character to level 89. If that works try setting them to 90. If setting them to 90 fails then this issue is almost certainly the result of an integer being cast incorrectly. To fix that, search your code for references to GetEXPForLevel. Look for code that is simliar to 'int x = GetEXPForLevel(blah)' and change it to 'uint32 x = GetEXPForLevel(blah)'. If it is not that simple, then you will have to start looking at the uses of 'x' in other parts of the code. |
Thank you for the assistance will look into this. And thank you for the criticism and everything... Appreciate you all. Like I said in the beginning of the post as far as C++ stuff goes I am n00bsauce.. I don't mean to upset anyone by my questions here, I thought that this was a forum that was for Support not flames and rants. As a Network Analyst my job is to build networks, servers, and troubleshoot workstations, no where in my job description is coding of any kind. Apologies if you thought I had boasted about coding at some point? I can only ever remember telling people I suck at this . Please forgive my ignorance, I don't mean to upset anyone I just want to fix my problem.
Mort |
Do we need to change this to double from float and add a con check for '(base*mod) > ~0'?
|
All times are GMT -4. The time now is 01:32 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.