Changeset 401 for tags/1.4.0/Units.pas
- Timestamp:
- Jan 6, 2025, 11:12:12 AM (3 days ago)
- Location:
- tags/1.4.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/1.4.0
-
tags/1.4.0/Units.pas
r376 r401 114 114 NewNode2: TDOMNode; 115 115 begin 116 RecalculateItemsId;117 116 for I := 0 to Count - 1 do 118 117 with Items[I] do begin … … 188 187 procedure TUnit.FixRefId; 189 188 begin 190 Player := TGame(Game).Players.FindById(PlayerId); 191 Kind := TGame(Game).GameSystem.UnitKinds.FindById(KindId); 189 if PlayerId <> 0 then begin 190 Player := TGame(Game).Players.FindById(PlayerId); 191 if not Assigned(Player) then 192 raise Exception.Create('Referenced player id ' + IntToStr(PlayerId) + ' not found.'); 193 end else Player := nil; 194 195 if KindId <> 0 then begin 196 Kind := TGame(Game).GameSystem.UnitKinds.FindById(KindId); 197 if not Assigned(Kind) then 198 raise Exception.Create('Referenced unit kind id ' + IntToStr(KindId) + ' not found.'); 199 end else Kind := nil; 192 200 end; 193 201
Note:
See TracChangeset
for help on using the changeset viewer.