Sir R. M8gic1an
2010-06-09 11:13:10
Here is what it is:
[php]
{******************************************************************************}
{ function MSI_GetDTMInfo(which: Integer): TIntegerArray; }
{ By: The MSI Team }
{ Description: Gets the coodinates for the DTM points }
{******************************************************************************}
function MSI_GetDTMInfo(which: Integer): TIntegerArray;
begin
case which of
HATCHET_BRONZE..HATCHET_RUNE:
Result := [ 586, 243, 587, 249, 574, 261, 575, 248, 587, 240 ];
LOGS_NORMAL..LOGS_YEW:
Result := [ 623, 291, 624, 279, 635, 296, 614, 299, 609, 289 ];
else
MSI_Debug('MSI_GetDTMInfo', 'Invalid item constant!', DEBUG_FUNCTIONS);
end;
end;
[/php]
Here is what I think it should be :
[php]
{******************************************************************************}
{ function MSI_GetDTMInfo(which: Integer): TPointArray; }
{ By: The MSI Team }
{ Description: Gets the coodinates for the DTM points }
{******************************************************************************}
function MSI_GetDTMInfo(which: Integer): TPointArray;
begin
case which of
HATCHET_BRONZE..HATCHET_RUNE:
Result := [
Point(586, 243), // Main Point
Point(587, 249),
Point(574, 261),
Point(575, 248),
Point(587, 240)
];
LOGS_NORMAL..LOGS_YEW:
Result := [
Point(623, 291), // Main Point
Point(624, 279),
Point(635, 296),
Point(614, 299),
Point(609, 289)
];
else
MSI_Debug('MSI_GetDTMInfo', 'Invalid item constant!', DEBUG_FUNCTIONS);
end;
end;
[/php]
Why? Good practice, these are not integers, these are points.
It's a bit more bloated, but definitely much clearer.
~RM
[php]
{******************************************************************************}
{ function MSI_GetDTMInfo(which: Integer): TIntegerArray; }
{ By: The MSI Team }
{ Description: Gets the coodinates for the DTM points }
{******************************************************************************}
function MSI_GetDTMInfo(which: Integer): TIntegerArray;
begin
case which of
HATCHET_BRONZE..HATCHET_RUNE:
Result := [ 586, 243, 587, 249, 574, 261, 575, 248, 587, 240 ];
LOGS_NORMAL..LOGS_YEW:
Result := [ 623, 291, 624, 279, 635, 296, 614, 299, 609, 289 ];
else
MSI_Debug('MSI_GetDTMInfo', 'Invalid item constant!', DEBUG_FUNCTIONS);
end;
end;
[/php]
Here is what I think it should be :
[php]
{******************************************************************************}
{ function MSI_GetDTMInfo(which: Integer): TPointArray; }
{ By: The MSI Team }
{ Description: Gets the coodinates for the DTM points }
{******************************************************************************}
function MSI_GetDTMInfo(which: Integer): TPointArray;
begin
case which of
HATCHET_BRONZE..HATCHET_RUNE:
Result := [
Point(586, 243), // Main Point
Point(587, 249),
Point(574, 261),
Point(575, 248),
Point(587, 240)
];
LOGS_NORMAL..LOGS_YEW:
Result := [
Point(623, 291), // Main Point
Point(624, 279),
Point(635, 296),
Point(614, 299),
Point(609, 289)
];
else
MSI_Debug('MSI_GetDTMInfo', 'Invalid item constant!', DEBUG_FUNCTIONS);
end;
end;
[/php]
Why? Good practice, these are not integers, these are points.
It's a bit more bloated, but definitely much clearer.
~RM