array index maths pt. 2

Forum Archive - from http://theuniversal.net
Locked
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

array index maths pt. 2

Post by morbydvisns »

Software:Universal Client
Version Number:
________________________________________________________________________
Location

________________________________________________________________________
Description:

Code: Select all


                             //Item Name, Start Research, Max Level , icon Filename
$t_ResearchItems[ ] =  {									
							"Sharpened Stick"    , 5 ,  2 , "www.tuwr.net/morvis/Data/Images/stickicon.jpg",
							"Rock"     , 8 ,  2 , "www.tuwr.net/morvis/Data/Images/StoneIcon.jpg",
							"Flint"    , 10 ,  3 , "www.tuwr.net/morvis/Data/Images/flinticon.jpg"

						}                             //Item Name, Start Research, Max Level , icon Filename
$t_ResearchItems[ ] =  {									
							"Sharpened Stick"    , 5 ,  2 , "www.tuwr.net/morvis/Data/Images/stickicon.jpg",
							"Rock"     , 8 ,  2 , "www.tuwr.net/morvis/Data/Images/StoneIcon.jpg",
							"Flint"    , 10 ,  3 , "www.tuwr.net/morvis/Data/Images/flinticon.jpg"

						}

   //   ($i = 1 in this case)
        $thumbIdx = $i + 3
	 $thumb = $t_ResearchItems[$i+3]

*say $thumb
*say's output is "www.tuwr.net/morvis/Data/Images/stickic ... ckicon.jpg"

________________________________________________________________________
Steps to Replicate:
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

Simply replacing the bracket maths with the $thumbIdx makes it show proper, only once in *say
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

nice find (and thanks for the easy replication case). Fixed server 0.68.3
Locked