public void StopEngine(BaseEntity.RPCMessage msg) { MiningQuarry parentEntity = base.GetParentEntity() as MiningQuarry; if (parentEntity) { parentEntity.EngineSwitch(false); } }
public void StopEngine(RPCMessage msg) { MiningQuarry miningQuarry = GetParentEntity() as MiningQuarry; if ((bool)miningQuarry) { miningQuarry.EngineSwitch(false); Interface.CallHook("OnQuarryToggled", miningQuarry, msg.player); } }
public void StopEngine(BaseEntity.RPCMessage msg) { MiningQuarry parentEntity = this.GetParentEntity() as MiningQuarry; if (!Object.op_Implicit((Object)parentEntity)) { return; } parentEntity.EngineSwitch(false); }
void OnQuarryToggled(MiningQuarry aExtractor, BasePlayer aPlayer) { /* This check takes care of 2 simple cases: * 1> The player is whitelisted, just remove * 2> Extractor was turned off, don't care about player ID, just remove */ if (permission.UserHasPermission(aPlayer.UserIDString, CPermWhitelist) || !aExtractor.IsEngineOn()) { FPlayerExtractorList.RemoveAll(x => aExtractor.net.ID == x.ExtractorId); return; } ExtractorType type; if (CPumpJackPrefabs.Contains(aExtractor.ShortPrefabName)) { type = ExtractorType.PumpJack; } else if (CQuarryPrefabs.Contains(aExtractor.ShortPrefabName)) { type = ExtractorType.Quarry; } else { // Skip anything we don't care about return; } if (FPlayerExtractorList.Count(x => aPlayer.userID == x.PlayerId && (FConfigData.IgnoreExtractorType || type == x.Type)) > 0) { // Turn engine OFF aExtractor.EngineSwitch(false); // Warn the player aPlayer.ChatMessage(lang.GetMessage("Warning Message Text", this, aPlayer.UserIDString)); return; } FPlayerExtractorList.Add(new QuarryState { PlayerId = aPlayer.userID, ExtractorId = aExtractor.net.ID, Type = type }); }