Changeset 336 for trunk/Player.pas
- Timestamp:
- Sep 7, 2024, 10:29:16 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Player.pas
r335 r336 776 776 begin 777 777 inherited; 778 WriteInteger(Node, 'StartCell', StartCell.Id); 778 if Assigned(StartCell) then 779 WriteInteger(Node, 'StartCell', StartCell.Id); 779 780 780 781 with Node do begin … … 809 810 810 811 destructor TPlayer.Destroy; 812 var 813 I: Integer; 811 814 begin 812 815 //Client := nil; … … 814 817 FreeAndNil(PlayerMap); 815 818 FreeAndNil(Moves); 819 for I := Units.Count - 1 downto 0 do 820 Units[I].Player := nil; 816 821 FreeAndNil(Units); 817 822 inherited; … … 828 833 TotalWinObjectiveCells := TPlayer(Source).TotalWinObjectiveCells; 829 834 StartCell := TPlayer(Source).StartCell; 835 Color := TPlayer(Source).Color; 836 //Units.Assign(TPlayer(Source).Units); 837 Nation := TPlayer(Source).Nation; 830 838 end; 831 839 … … 978 986 // Clean from cell from empty units 979 987 if UnitMove.CellFrom.MapCell.OneUnit.Power = 0 then begin 980 Unit s.Remove(UnitMove.CellFrom.MapCell.OneUnit);988 UnitMove.CellFrom.MapCell.OneUnit.Player := nil; 981 989 UnitMove.CellFrom.MapCell.OneUnit := nil; 982 990 end; … … 1036 1044 OneUnit := MapCell.OneUnit; 1037 1045 MapCell.OneUnit := nil; 1038 Units.Remove(OneUnit);1046 OneUnit.Player := nil; 1039 1047 end; 1040 1048 end; … … 1286 1294 NewUnit.Player := Self; 1287 1295 NewUnit.MapCell := Cells[I]; 1288 Units.Add(NewUnit);1289 1296 end; 1290 1297 if OneUnit.Power < MaxPower then begin
Note:
See TracChangeset
for help on using the changeset viewer.