Example #1
0
        public override void SharedUpdate(double deltaTime)
        {
            if (this.CharacterPublicState.SelectedItem != this.ItemConstructionTool)
            {
                this.AbortAction();
                return;
            }

            if (!ConstructionSystem.SharedCheckCanInteract(
                    this.Character,
                    this.WorldObject,
                    writeToLog: true))
            {
                this.AbortAction();
                return;
            }

            this.currentStageTimeRemainsSeconds -= deltaTime;
            if (this.currentStageTimeRemainsSeconds <= 0)
            {
                this.SharedOnStageCompleted();
            }
            else if (Api.IsClient)
            {
                if (this.ObjectPublicState.StructurePointsCurrent >= this.structurePointsMax)
                {
                    // apparently the building finished construction/repair before the client simulation was complete
                    this.AbortAction();
                }
            }

            this.UpdateProgress();
        }
Example #2
0
        public override void SharedUpdate(double deltaTime)
        {
            if (this.CharacterPublicState.SelectedHotbarItem != this.ItemConstructionTool)
            {
                this.AbortAction();
                return;
            }

            if (!ConstructionSystem.SharedCheckCanInteract(
                    this.Character,
                    this.WorldObject,
                    writeToLog: true))
            {
                this.AbortAction();
                return;
            }

            this.currentStageTimeRemainsSeconds -= deltaTime;
            if (this.currentStageTimeRemainsSeconds <= 0)
            {
                this.SharedOnStageCompleted();
            }

            this.UpdateProgress();
        }