- Added more checks to statics loading and saving and replaced unnecessary LongInt casts

This commit is contained in:
2009-03-09 17:24:53 +01:00
parent 114c218ca6
commit 7e86c7400c
3 changed files with 383 additions and 384 deletions
+2 -2
View File
@@ -479,14 +479,14 @@ begin
FStaIdx.Position := ((AWorldBlock.X * FHeight) + AWorldBlock.Y) * 12;
index := TGenericIndex.Create(FStaIdx);
size := AWorldBlock.GetSize;
if (size > index.Size) or (index.Lookup = LongInt($FFFFFFFF)) then
if (size > index.Size) or (index.Lookup < 0) then
begin
FStatics.Position := FStatics.Size;
index.Lookup := FStatics.Position;
end;
index.Size := size;
if size = 0 then
index.Lookup := LongInt($FFFFFFFF)
index.Lookup := -1
else
begin
FStatics.Position := index.Lookup;