Changeset 409 for tags/1.4.0/Map.pas
- Timestamp:
- Jan 8, 2025, 11:01:27 AM (34 hours ago)
- Location:
- tags/1.4.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/1.4.0
-
tags/1.4.0/Map.pas
r401 r409 48 48 Extra: TExtraType; 49 49 OneUnitId: Integer; // Temporary value 50 BuildingId: Integer; // Temporary value 50 51 function Compare(Cell: TCell): Boolean; 51 52 procedure ConnectTo(Cell: TCell); … … 1064 1065 end else Player := nil; 1065 1066 1067 if BuildingId <> 0 then begin 1068 Building := TGame(Map.Game).Buildings.FindById(BuildingId); 1069 if not Assigned(Building) then 1070 raise Exception.Create('Referenced building id ' + IntToStr(BuildingId) + ' not found.'); 1071 end else Building := nil; 1072 1066 1073 if OneUnitId <> 0 then begin 1067 1074 OneUnit := TGame(Map.Game).Units.FindById(OneUnitId); … … 1095 1102 PosPx.Y := ReadInteger(Node, 'PosY', 0); 1096 1103 PlayerId := ReadInteger(Node, 'Player', 0); 1104 BuildingId := ReadInteger(Node, 'Building', 0); 1097 1105 1098 1106 Node3 := Node.FindNode('Neighbours'); … … 1135 1143 WriteInteger(Node, 'Player', TPlayer(Player).Id) 1136 1144 else WriteInteger(Node, 'Player', 0); 1145 if Assigned(Building) then 1146 WriteInteger(Node, 'Building', Building.Id) 1147 else WriteInteger(Node, 'Building', 0); 1137 1148 NewNode := Node.OwnerDocument.CreateElement('Neighbours'); 1138 1149 Node.AppendChild(NewNode);
Note:
See TracChangeset
for help on using the changeset viewer.