Skip to content

Commit cabc1f1

Browse files
committed
Fix SimAntics unit test
1 parent 5611766 commit cabc1f1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Assets/Scripts/OpenTS2/SimAntics/VM.cs

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ public void Tick()
7474
}
7575
catch(Exception e)
7676
{
77+
// If we don't have an exception handler just re-throw to avoid swallowing errors.
78+
if (ExceptionHandler == null)
79+
{
80+
throw;
81+
}
7782
ExceptionHandler?.Invoke(e, entity);
7883
}
7984
}

Assets/Scripts/OpenTS2/SimAntics/VMEntity.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ public void Delete()
113113
public BHAVAsset GetBHAV(ushort treeID)
114114
{
115115
// 0x0XXX is global scope, 0x1XXX is private scope and 0x2XXX is semiglobal scope.
116-
var groupid = SemiGlobalGroupID;
116+
uint groupid;
117117

118118
if (treeID < 0x1000)
119119
groupid = GroupIDs.Global;
120120
else if (treeID < 0x2000)
121121
groupid = PrivateGroupID;
122+
else
123+
groupid = SemiGlobalGroupID;
122124

123125
return VM.GetBHAV(treeID, groupid);
124126
}

0 commit comments

Comments
 (0)