- Fixed TfrmMain.SetCurrentTile to exit only under correct conditions
- Fixed ghost tile creation to handle random height - Changed UpdateSelection to only process the selection changes if necessary - Changed TMapCell.GhostZ to be readable (necessary for simplier increase with random altitude)
This commit is contained in:
parent
211866d6c1
commit
20747a4e0c
|
@ -1639,7 +1639,7 @@ end;
|
|||
|
||||
procedure TfrmMain.SetCurrentTile(const AValue: TWorldItem);
|
||||
begin
|
||||
if AValue = FSelectedTile then
|
||||
if AValue = FCurrentTile then
|
||||
Exit;
|
||||
|
||||
if FCurrentTile <> nil then
|
||||
|
@ -2318,6 +2318,8 @@ procedure TfrmMain.UpdateSelection;
|
|||
cell.GhostZ := frmDrawSettings.seForceAltitude.Value
|
||||
else
|
||||
cell.GhostZ := cell.RawZ;
|
||||
if frmDrawSettings.cbRandomHeight.Checked then
|
||||
cell.GhostZ := cell.GhostZ + Random(frmDrawSettings.seRandomHeight.Value);
|
||||
|
||||
OnMapChanged(cell);
|
||||
end;
|
||||
|
@ -2336,6 +2338,9 @@ procedure TfrmMain.UpdateSelection;
|
|||
ResMan.Tiledata.StaticTiles[ABaseTile.TileID].Height;
|
||||
end else
|
||||
ghostTile.Z := frmDrawSettings.seForceAltitude.Value;
|
||||
if frmDrawSettings.cbRandomHeight.Checked then
|
||||
ghostTile.Z := ghostTile.Z +
|
||||
Random(frmDrawSettings.seRandomHeight.Value);
|
||||
|
||||
ghostTile.UpdatePriorities(ResMan.Tiledata.StaticTiles[ghostTile.TileID],
|
||||
MaxInt);
|
||||
|
@ -2357,6 +2362,11 @@ var
|
|||
i, tileX, tileY: Integer;
|
||||
begin
|
||||
Logger.EnterMethod([lcClient, lcDebug], 'UpdateSelection');
|
||||
|
||||
//If the current tile is nil, but we still have a selected tile, the
|
||||
//procedure is pointless - the selection should stay intact.
|
||||
if (CurrentTile <> nil) or (SelectedTile = nil) then
|
||||
begin
|
||||
if CurrentTile = nil then
|
||||
selectedRect := Rect(-1, -1, -1, -1)
|
||||
else
|
||||
|
@ -2415,6 +2425,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
FSelection := selectedRect;
|
||||
end;
|
||||
Logger.ExitMethod([lcClient, lcDebug], 'UpdateSelection');
|
||||
end;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ type
|
|||
public
|
||||
property Altitude: ShortInt read GetZ write SetZ;
|
||||
property IsGhost: Boolean read FIsGhost write FIsGhost;
|
||||
property GhostZ: ShortInt write FGhostZ;
|
||||
property GhostZ: ShortInt read FGhostZ write FGhostZ;
|
||||
property GhostID: Word write FGhostID;
|
||||
|
||||
function Clone: TMapCell; override;
|
||||
|
|
Loading…
Reference in New Issue