Changeset 273 for trunk/UPlayer.pas
- Timestamp:
- Jan 30, 2019, 8:08:44 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UPlayer.pas
r265 r273 122 122 procedure ReduceMovesPower; 123 123 procedure RemoveInvalidMoves; 124 procedure RemoveEmptyUnits; 124 125 procedure UpdateRepeatMoves; 125 126 procedure UpdateEmptyCellsNeutral; … … 1059 1060 if Moves[I].CellFrom.MapCell.Player <> Self then 1060 1061 Moves.Delete(I); 1062 end; 1063 1064 procedure TPlayer.RemoveEmptyUnits; 1065 var 1066 I: Integer; 1067 OneUnit: TUnit; 1068 begin 1069 for I := 0 to PlayerMap.Cells.Count - 1 do 1070 with TPlayerCell(PlayerMap.Cells[I]) do begin 1071 if Assigned(MapCell.OneUnit) and (MapCell.OneUnit.Power = 0) then begin 1072 OneUnit := MapCell.OneUnit; 1073 MapCell.OneUnit := nil; 1074 Units.Remove(OneUnit); 1075 end; 1076 end; 1061 1077 end; 1062 1078 … … 1154 1170 for I := 0 to PlayerMap.Cells.Count - 1 do 1155 1171 with TPlayerCell(PlayerMap.Cells[I]) do begin 1156 if MapCell.OneUnit.Power = 0 then MapCell.Player := nil; 1172 if Assigned(MapCell.OneUnit) and (MapCell.OneUnit.Power = 0) then 1173 MapCell.Player := nil; 1157 1174 end; 1158 1175 end;
Note:
See TracChangeset
for help on using the changeset viewer.