RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[2.0 SVN 259] Error in Fishing.cs

panther

Sorceror
[2.0 SVN 259] Error in Fishing.cs

I believe there's a minor mistake in Scripts\Engines\Harvest\Fishing.cs -
TreasureMapChest.Fill( chest, Math.Max( 1, Math.Max( 4, sos.Level ) ) );

Should be:
TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, sos.Level ) ) );
 
panther;711968 said:
I believe there's a minor mistake in Scripts\Engines\Harvest\Fishing.cs -
TreasureMapChest.Fill( chest, Math.Max( 1, Math.Max( 4, sos.Level ) ) );

Should be:
TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, sos.Level ) ) );


actualy your way also does nopt work either

in all cases - yours and theres - the only answer is 1 or 0 and with yours 1 only (yor min is always at least 4 and woth max of 1 = 1)

so they have something realy screwed up there with that formula
 

panther

Sorceror
Lord_Greywolf;712006 said:
actualy your way also does nopt work either

in all cases - yours and theres - the only answer is 1 or 0 and with yours 1 only (yor min is always at least 4 and woth max of 1 = 1)

so they have something realy screwed up there with that formula

Seems fine to me.

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, sos.Level ) ) );

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, 0 ) ) );
TreasureMapChest.Fill( chest, Math.Max( 1, 0 ) );
TreasureMapChest.Fill( chest, 1 );

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, 1 ) ) );
TreasureMapChest.Fill( chest, Math.Max( 1, 1 ) );
TreasureMapChest.Fill( chest, 1 );

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, 2 ) ) );
TreasureMapChest.Fill( chest, Math.Max( 1, 2 ) );
TreasureMapChest.Fill( chest, 2 );

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, 3 ) ) );
TreasureMapChest.Fill( chest, Math.Max( 1, 3 ) );
TreasureMapChest.Fill( chest, 3 );

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, 4 ) ) );
TreasureMapChest.Fill( chest, Math.Max( 1, 4 ) );
TreasureMapChest.Fill( chest, 4 );

TreasureMapChest.Fill( chest, Math.Max( 1, Math.Min( 4, 5 ) ) );
TreasureMapChest.Fill( chest, Math.Max( 1, 4 ) );
TreasureMapChest.Fill( chest, 4 );

This is the same formula they use in SOS.cs to set the level. Keeps the level in the range of 1-4.
 
Top