Methods of floats..
#5

Код:
new Float:treePos[8][3]={
	{661.91,1289.53,10.71},
	{640.08,1289.37,10.71},
	{685.15,1257.14,10.71},
	{695.25,1231.59,10.14},
	{661.87,1190.05,10.71},
	{639.62,1190.14,9.93},
	{571.27,1256.64,10.71},
	{554.25,1242.15,10.71}
};
looks a lot better, using the previously mentioned methods, i prefer to order the numbers with leading zeros tho:
Код:
new Float:treePos[8][3]={
	{0661.9100,1289.5300,0010.7100},
	{0640.0800,1289.3700,0010.7100},
	{0685.1500,1257.1400,0010.7100},
	{0695.2500,1231.5900,0010.1400},
	{0661.8700,1190.0500,0010.7100},
	{0639.6200,1190.1400,0009.9300},
	{0571.2700,1256.6400,0010.7100},
	{0554.2500,1242.1500,0010.7100}
};
..its a bit easier to read.
the variable treeExists[] is redundant imo, if you create an object, it will never return 0 (as object id), so any created obejct will write the returned id into treeObj[], therefore you can simply check for the object existance like
Код:
if(IsValidObject(treeObj[t]))
instead using treeExists[]
hm.. i think the code can be optimized furthermore, but youll face that later (like hashing back object ids in another array, like a two-sided pointer from 1 array to another and vice versa)
Reply


Messages In This Thread
Methods of floats.. - by 2KY - 22.10.2012, 13:35
Re: Methods of floats.. - by XRabbit - 22.10.2012, 13:45
Re: Methods of floats.. - by Babul - 22.10.2012, 15:07
Re: Methods of floats.. - by 2KY - 22.10.2012, 15:21
Re: Methods of floats.. - by Babul - 22.10.2012, 19:08

Forum Jump:


Users browsing this thread: 1 Guest(s)