Changeset 307 for trunk


Ignore:
Timestamp:
Aug 18, 2021, 11:18:39 AM (3 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Systems/Dune 2.xts

    r304 r307  
    22<XtacticsGameSystem>
    33  <UnitsSplitMerge>0</UnitsSplitMerge>
    4   <EmptyCellsNeutral>0</EmptyCellsNeutral>
     4  <EmptyCellsNeutral>-1</EmptyCellsNeutral>
    55  <UnitsMoveImmediately>-1</UnitsMoveImmediately>
    66  <PreferedMapType>2</PreferedMapType>
  • trunk/UMap.pas

    r299 r307  
    6363    function GetColor: TColor;
    6464    function ToString: ansistring; override;
     65    procedure CheckOwnership;
    6566    constructor Create;
    6667    destructor Destroy; override;
     
    11191120end;
    11201121
     1122procedure TCell.CheckOwnership;
     1123begin
     1124  if TGame(Map.Game).GameSystem.EmptyCellsNeutral then
     1125  if Assigned(Player) and  (Assigned(OneUnit) and (OneUnit.Power = 0)) or
     1126    not Assigned(OneUnit) then
     1127      Player := nil;
     1128end;
     1129
    11211130constructor TCell.Create;
    11221131begin
  • trunk/UPlayer.pas

    r303 r307  
    973973    end;
    974974    CellFrom.MapCell.OneUnit.Power := CellFrom.MapCell.OneUnit.Power - UnitCount;
     975    CellFrom.MapCell.CheckOwnership;
    975976  end;
    976977
     
    11451146  for I := 0 to PlayerMap.Cells.Count - 1 do
    11461147  with TPlayerCell(PlayerMap.Cells[I]) do begin
    1147     if Assigned(MapCell.OneUnit) and (MapCell.OneUnit.Power = 0) then
    1148       MapCell.Player := nil;
     1148    MapCell.CheckOwnership;
    11491149  end;
    11501150end;
Note: See TracChangeset for help on using the changeset viewer.