internal override void Execute() { GameObject gameObject = this.Device.GameMode.Level.GameObjectManager.Filter.GetGameObjectById(this.BuildingId); if (gameObject != null) { if (gameObject is Building) { Building building = (Building)gameObject; UnitUpgradeComponent unitUpgradeComponent = building.UnitUpgradeComponent; if (unitUpgradeComponent != null) { unitUpgradeComponent.SpeedUp(); } else { Logging.Error(this.GetType(), "Unable to speed up the unit upgrade. The game object doesn't contain a UnitUpgradeComponent."); } } else { Logging.Error(this.GetType(), "Unable to speed up the unit upgrade. The game object is not a building."); } } else { Logging.Error(this.GetType(), "Unable to speed up the unit upgrade. The game object is null"); } }
public override void Execute(Level level) { GameObject gameObjectById = level.GameObjectManager.GetGameObjectByID(m_vBuildingId); if (gameObjectById == null || gameObjectById.ClassId != 0) { return; } UnitUpgradeComponent upgradeComponent = ((ConstructionItem)gameObjectById).GetUnitUpgradeComponent(false); if ((upgradeComponent != null ? upgradeComponent.GetCurrentlyUpgradedUnit() : (CombatItemData)null) == null) { return; } upgradeComponent.SpeedUp(); }
//00 00 02 05 1D CD 65 13 00 00 53 8F public override void Execute(Level level) { ClientAvatar ca = level.GetPlayerAvatar(); GameObject go = level.GameObjectManager.GetGameObjectByID(m_vBuildingId); if (go != null) { if (go.ClassId == 0) { Building b = (Building)go; UnitUpgradeComponent uuc = b.GetUnitUpgradeComponent(); if (uuc != null) { if (uuc.GetCurrentlyUpgradedUnit() != null) { uuc.SpeedUp(); } } } } }