Skip to content

Commit bf2e3e7

Browse files
committed
bug fixes
1 parent 221703f commit bf2e3e7

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

IndustrialPark/ArchiveEditor/ArchiveEditor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ private void buttonPaste_Click(object sender, EventArgs e)
759759
if (!archive.NoLayers)
760760
comboBoxLayers.Items[archive.SelectedLayerIndex] = archive.LayerToString();
761761

762+
PopulateAssetListAndComboBox();
762763
SetSelectedIndices(finalIndices, true);
763764
SetupAssetVisibilityButtons();
764765
}

IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,8 @@ public void PasteAssetsFromClipboard(out List<uint> finalIndices, AssetClipboard
12591259

12601260
asset.SetGame(game);
12611261

1262-
referenceUpdate.Add(previousAssetID, asset.assetID);
1262+
if (previousAssetID != 0)
1263+
referenceUpdate.Add(previousAssetID, asset.assetID);
12631264

12641265
if (asset is AssetSound sound)
12651266
{

IndustrialPark/Assets/ObjectAssets/AssetSCRP.cs

+11-8
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,17 @@ public AssetSCRP(Section_AHDR AHDR, Game game, Endianness endianness) : base(AHD
6666
Flag4 = reader.ReadByte();
6767
}
6868

69-
int timedLinkSize = (int)((reader.BaseStream.Length - reader.BaseStream.Position - Link.sizeOfStruct * _links.Length) / timedLinkCount);
70-
71-
if (timedLinkSize == 0x24)
72-
AssetVersion = EVersionROTUOthers.ROTU;
73-
else if (timedLinkSize == 0x20)
74-
AssetVersion = EVersionROTUOthers.Others;
75-
else
76-
throw new Exception("Unsupported format");
69+
if (timedLinkCount != 0)
70+
{
71+
int timedLinkSize = (int)((reader.BaseStream.Length - reader.BaseStream.Position - Link.sizeOfStruct * _links.Length) / timedLinkCount);
72+
73+
if (timedLinkSize == 0x24)
74+
AssetVersion = EVersionROTUOthers.ROTU;
75+
else if (timedLinkSize == 0x20)
76+
AssetVersion = EVersionROTUOthers.Others;
77+
else
78+
throw new Exception("Unsupported format");
79+
}
7780

7881
_timedLinks = new Link[timedLinkCount];
7982
for (int i = 0; i < _timedLinks.Length; i++)

IndustrialPark/Assets/Shared/GenericAssetDataContainer.cs

+3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public virtual bool HasReference(uint assetID) =>
5656

5757
public virtual void ReplaceReferences(uint oldAssetId, uint newAssetId)
5858
{
59+
if (oldAssetId == 0)
60+
return;
61+
5962
var typeProperties = GetType().GetProperties();
6063

6164
foreach (var prop in typeProperties.Where(prop => prop.PropertyType.Equals(typeof(AssetID)) && ((AssetID)prop.GetValue(this)).Equals(oldAssetId)))

IndustrialPark/IndustrialPark.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@
694694
</EmbeddedResource>
695695
<EmbeddedResource Include="MainForm\MainForm.resx">
696696
<DependentUpon>MainForm.cs</DependentUpon>
697+
<SubType>Designer</SubType>
697698
</EmbeddedResource>
698699
<EmbeddedResource Include="MainForm\ViewConfig.resx">
699700
<DependentUpon>ViewConfig.cs</DependentUpon>

0 commit comments

Comments
 (0)