PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Min() and Max() always returns double (POL097-2008-02-26)

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 097
Display posts from previous:   

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 107

PostPosted: Mon Mar 10, 2008 1:08 am    Post subject: Min() and Max() always returns double (POL097-2008-02-26) Reply with quote

Regardless of the types of the variables passed in function Min() or Max(), the value returned is always double.

Using following code you can see it by yourself.

Code:

var x := 1;
var y := 2;

Print("Type of x: " + TypeOf(x) + ", type of y: " + TypeOf(y)); // -> integer, integer

var maxxy := Max(x, y);
var minxy := Min(x, y);

Print("Return value of maxxy: " + maxxy + ", type of maxxy: " + TypeOf(maxxy)); // -> 2, double
Print("Return value of minxy: " + minxy + ", type of minxy: " + TypeOf(minxy)); // -> 1, double


Also the documentations have errors in it, as the mentioned functions are told to return integer.

This is very annoying bug because before this release, we already had our own Min and Max functions that worked correctly, and because of this bug we should have integer conversations in places never needed it before, resulting weird behaviour in some scripts.

As a feature request I wish Min() and Max() would not change the type of the larger or smaller value at all: so if 0 (integer) and 2.2 (double) is passed to Max(), it would return 2.2 (double), and if they are passed in Min(), it would return 0 (integer).

Author Message
Demostenes



Joined: 29 Aug 2007
Posts: 24

PostPosted: Mon Mar 10, 2008 2:11 pm    Post subject: Reply with quote

The newest release is one big surprise. There was much more changes, than is written in change.log, so since release, we are still discovering, how much things stopped working and why.
For exaxmple yesterday we were fixing some problem and to 4 o'clock in the morning trying to discover, why our in-game html help stopped working properly since new core. After some time, we found out, that there some forbidden chars in unpack function (or more precisely aux connection)
now.....
I have nothing against changes, but they should be documented.

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 107

PostPosted: Tue Mar 11, 2008 4:47 am    Post subject: Reply with quote

"[Changes] should be documented."
So should be the bugs.

I bet there are many core bugs discovered times ago that are either never reported or just forgotten because of a new core release.

Author Message
CWO



Joined: 04 Feb 2006
Posts: 677
Location: Chicago, IL USA

PostPosted: Tue Mar 11, 2008 5:06 am    Post subject: Reply with quote

You might even see it in your own scripts sometimes too... Changing certain things might affect other things on your shard even if they seem unrelated to your players. Only you would know if you knew your scriptbase completely how they would be related. Same thing can happen with core devs developing the core.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 097 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty