@@ -108,6 +108,7 @@ private void ActionBuildEvent(BuildEvent buildEvent)
108
108
109
109
private void BuildBasePiece ( BasePiecePlacedEvent basePiecePlacedBuildEvent )
110
110
{
111
+ Log . Info ( "BuildBasePiece " + basePiecePlacedBuildEvent . BasePiece . Guid + " " + basePiecePlacedBuildEvent . BasePiece . TechType ) ;
111
112
BasePiece basePiece = basePiecePlacedBuildEvent . BasePiece ;
112
113
GameObject buildPrefab = CraftData . GetBuildPrefab ( basePiece . TechType ) ;
113
114
MultiplayerBuilder . overridePosition = basePiece . ItemPosition ;
@@ -124,7 +125,7 @@ private void BuildBasePiece(BasePiecePlacedEvent basePiecePlacedBuildEvent)
124
125
125
126
if ( basePiece . ParentGuid . IsPresent ( ) )
126
127
{
127
- parentBase = GuidHelper . RequireObjectFrom ( basePiece . ParentGuid . Get ( ) ) ;
128
+ parentBase = GuidHelper . GetObjectFrom ( basePiece . ParentGuid . Get ( ) ) . OrElse ( null ) ;
128
129
}
129
130
130
131
Constructable constructable ;
@@ -155,6 +156,7 @@ private void BuildBasePiece(BasePiecePlacedEvent basePiecePlacedBuildEvent)
155
156
156
157
private void ConstructionCompleted ( ConstructionCompletedEvent constructionCompleted )
157
158
{
159
+ Log . Info ( "Constructed completed " + constructionCompleted . Guid ) ;
158
160
GameObject constructing = GuidHelper . RequireObjectFrom ( constructionCompleted . Guid ) ;
159
161
160
162
ConstructableBase constructableBase = constructing . GetComponent < ConstructableBase > ( ) ;
@@ -176,12 +178,12 @@ private void ConstructionCompleted(ConstructionCompletedEvent constructionComple
176
178
Constructable constructable = constructing . GetComponent < Constructable > ( ) ;
177
179
constructable . constructedAmount = 1f ;
178
180
constructable . SetState ( true , true ) ;
179
- }
181
+ }
180
182
181
- if ( constructionCompleted . NewBaseCreatedGuid . IsPresent ( ) )
183
+ if ( constructionCompleted . BaseGuid != null && GuidHelper . GetObjectFrom ( constructionCompleted . BaseGuid ) . IsEmpty ( ) )
182
184
{
183
- string newBaseGuid = constructionCompleted . NewBaseCreatedGuid . Get ( ) ;
184
- ConfigureNewlyConstructedBase ( newBaseGuid ) ;
185
+ Log . Info ( "Creating base: " + constructionCompleted . BaseGuid ) ;
186
+ ConfigureNewlyConstructedBase ( constructionCompleted . BaseGuid ) ;
185
187
}
186
188
}
187
189
0 commit comments