Changeset 278 for trunk/UUnit.pas


Ignore:
Timestamp:
Feb 14, 2019, 10:25:13 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Incorrect way to assign units between two game systems causing crash of the application on exit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UUnit.pas

    r277 r278  
    3636    procedure SaveToNode(Node: TDOMNode);
    3737    constructor Create(FreeObjects: Boolean = True);
     38    procedure Assign(Source: TUnitKinds);
    3839  end;
    3940
     
    353354end;
    354355
     356procedure TUnitKinds.Assign(Source: TUnitKinds);
     357var
     358  I: Integer;
     359begin
     360  while Count > Source.Count do Delete(Count - 1);
     361  while Count < Source.Count do AddNew('');
     362  for I := 0 to Count - 1 do
     363    Items[I].Assign(Source.Items[I]);
     364end;
     365
    355366end.
    356367
Note: See TracChangeset for help on using the changeset viewer.