From 086e6dbb7b64bb816f19881861296ad34ebc7afd Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 29 Mar 2011 22:04:39 +0200 Subject: [PATCH] - Fixed some range violations --- Client/CentrED.lpi | 3 +++ Client/ULandscape.pas | 12 ++++++------ UOLib/UArt.pas | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Client/CentrED.lpi b/Client/CentrED.lpi index c5f6dc8..012bb7d 100644 --- a/Client/CentrED.lpi +++ b/Client/CentrED.lpi @@ -444,6 +444,9 @@ + + + diff --git a/Client/ULandscape.pas b/Client/ULandscape.pas index 2c01e80..63cd171 100644 --- a/Client/ULandscape.pas +++ b/Client/ULandscape.pas @@ -188,8 +188,8 @@ type FMaxStaticID: Cardinal; { Methods } function GetMapBlock(AX, AY: Word): TMapBlock; - function GetMapCell(AX, AY: Word): TMapCell; - function GetNormals(AX, AY: Word): TNormals; + function GetMapCell(AX, AY: Integer): TMapCell; + function GetNormals(AX, AY: Integer): TNormals; function GetStaticBlock(AX, AY: Word): TSeperatedStaticBlock; function GetStaticList(AX, AY: Word): TStaticItemList; { Events } @@ -207,9 +207,9 @@ type property Height: Word read FHeight; property CellWidth: Word read FCellWidth; property CellHeight: Word read FCellHeight; - property MapCell[X, Y: Word]: TMapCell read GetMapCell; + property MapCell[X, Y: Integer]: TMapCell read GetMapCell; property StaticList[X, Y: Word]: TStaticItemList read GetStaticList; - property Normals[X, Y: Word]: TNormals read GetNormals; + property Normals[X, Y: Integer]: TNormals read GetNormals; property MaxStaticID: Cardinal read FMaxStaticID; property OnChange: TLandscapeChangeEvent read FOnChange write FOnChange; property OnMapChanged: TMapChangedEvent read FOnMapChanged write FOnMapChanged; @@ -661,7 +661,7 @@ begin end; end; -function TLandscape.GetMapCell(AX, AY: Word): TMapCell; +function TLandscape.GetMapCell(AX, AY: Integer): TMapCell; var block: TMapBlock; begin @@ -674,7 +674,7 @@ begin end; end; -function TLandscape.GetNormals(AX, AY: Word): TNormals; +function TLandscape.GetNormals(AX, AY: Integer): TNormals; begin GetNormals(AX, AY, Result); end; diff --git a/UOLib/UArt.pas b/UOLib/UArt.pas index 359437b..3cffa41 100644 --- a/UOLib/UArt.pas +++ b/UOLib/UArt.pas @@ -60,7 +60,7 @@ implementation type PWordArray = ^TWordArray; - TWordArray = array[0..16383] of Word; + TWordArray = array[0..(MaxInt div SizeOf(Word) - 1)] of Word; constructor TArt.Create(AData: TStream; AIndex: TGenericIndex; AArtType: TArtType); begin