From 2afd5f2cf5288cceb684d084df6ff05d0f3d94ea Mon Sep 17 00:00:00 2001 From: GunHog Date: Thu, 30 Mar 2017 15:39:43 -0500 Subject: [PATCH 1/3] Mech fixes - Fixes mech mining scanner being unclickable - Fixes mech action buttons breaking upon being regranted --- code/game/mecha/equipment/tools/mining_tools.dm | 1 + code/game/mecha/mecha_actions.dm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm index 3ac2e54f7ed..61151f086f3 100644 --- a/code/game/mecha/equipment/tools/mining_tools.dm +++ b/code/game/mecha/equipment/tools/mining_tools.dm @@ -112,6 +112,7 @@ var/scanning = 0 /obj/item/mecha_parts/mecha_equipment/mining_scanner/New() + ..() START_PROCESSING(SSobj, src) /obj/item/mecha_parts/mecha_equipment/mining_scanner/attach(obj/mecha/M) diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index 3a3d979537c..65fa8b49b9e 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -25,7 +25,8 @@ var/obj/mecha/chassis /datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M) - chassis = M + if(M) + chassis = M ..() /datum/action/innate/mecha/Destroy() From 4bce1f1262b051abcb936222ad682273e12a74cc Mon Sep 17 00:00:00 2001 From: GunHog Date: Fri, 31 Mar 2017 12:06:37 -0500 Subject: [PATCH 2/3] MOAR FIXES - Fixed a runtime which caused AIs carded from a mech to retain its mech actions - AIs deployed to an AI shell are now disconnected when carded to/from mechs. - AIs uploaded to a mech from a card no longer have an eject action, even if that AI entered the mech wirelessly. - The readouts of mech beacons are no longer massively spaced in the AI's chat readout and are more compact on the mech console as well. --- code/game/mecha/mecha.dm | 15 +++++++++++---- code/game/mecha/mecha_control_console.dm | 14 +++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 84010473806..f609759d1cf 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -663,9 +663,11 @@ AI.ai_restore_power()//So the AI initially has power. AI.control_disabled = 1 AI.radio_enabled = 0 + AI.disconnect_shell() + RemoveActions(AI, 1) + occupant = null AI.forceMove(card) card.AI = AI - occupant = null AI.controlled_mech = null AI.remote_control = null icon_state = initial(icon_state)+"-open" @@ -686,10 +688,12 @@ if(!AI) to_chat(user, "There is no AI currently installed on this device.") return - else if(AI.stat || !AI.client) + if(AI.deployed_shell) //Recall AI if shelled so it can be checked for a client + AI.disconnect_shell() + if(AI.stat || !AI.client) to_chat(user, "[AI.name] is currently unresponsive, and cannot be uploaded.") return - else if(occupant || dna_lock) //Normal AIs cannot steal mechs! + if(occupant || dna_lock) //Normal AIs cannot steal mechs! to_chat(user, "Access denied. [name] is [occupant ? "currently occupied" : "secured with a DNA lock"].") return AI.control_disabled = 0 @@ -715,7 +719,10 @@ to_chat(AI, "[AI.can_dominate_mechs ? "Takeover of [name] complete! You are now loaded onto the onboard computer. Do not attempt to leave the station sector!" \ : "You have been uploaded to a mech's onboard computer."]") to_chat(AI, "Use Middle-Mouse to activate mech functions and equipment. Click normally for AI interactions.") - GrantActions(AI, !AI.can_dominate_mechs) + if(interaction == AI_TRANS_FROM_CARD) + GrantActions(AI, 0) //No eject/return to core action for AI uploaded by card + else + GrantActions(AI, !AI.can_dominate_mechs) //An actual AI (simple_animal mecha pilot) entering the mech diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 97b3cd959b4..bbafd46dd24 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -75,13 +75,13 @@ return 0 var/obj/mecha/M = src.loc var/cell_charge = M.get_charge() - var/answer = {"Name: [M.name]
- Integrity: [M.obj_integrity/M.max_integrity*100]%
- Cell charge: [isnull(cell_charge)?"Not found":"[M.cell.percent()]%"]
- Airtank: [M.return_pressure()]kPa
- Pilot: [M.occupant||"None"]
- Location: [get_area(M)||"Unknown"]
- Active equipment: [M.selected||"None"]
"} + var/answer = {"Name: [M.name] +Integrity: [M.obj_integrity/M.max_integrity*100]% +Cell charge: [isnull(cell_charge)?"Not found":"[M.cell.percent()]%"] +Airtank: [M.return_pressure()]kPa +Pilot: [M.occupant||"None"] +Location: [get_area(M)||"Unknown"] +Active equipment: [M.selected||"None"] "} if(istype(M, /obj/mecha/working/ripley)) var/obj/mecha/working/ripley/RM = M answer += "Used cargo space: [RM.cargo.len/RM.cargo_capacity*100]%
" From 7fc575462233ff2041a427fa1a34c1b5baf9e7fa Mon Sep 17 00:00:00 2001 From: GunHog Date: Sat, 1 Apr 2017 23:04:09 -0500 Subject: [PATCH 3/3] THE TRUTH IS FALSE!!!! Replaces 1 and 0 with TRUE and FALSE --- code/game/mecha/mecha.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index f609759d1cf..9ec72374407 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -664,7 +664,7 @@ AI.control_disabled = 1 AI.radio_enabled = 0 AI.disconnect_shell() - RemoveActions(AI, 1) + RemoveActions(AI, TRUE) occupant = null AI.forceMove(card) card.AI = AI @@ -720,7 +720,7 @@ : "You have been uploaded to a mech's onboard computer."]") to_chat(AI, "Use Middle-Mouse to activate mech functions and equipment. Click normally for AI interactions.") if(interaction == AI_TRANS_FROM_CARD) - GrantActions(AI, 0) //No eject/return to core action for AI uploaded by card + GrantActions(AI, FALSE) //No eject/return to core action for AI uploaded by card else GrantActions(AI, !AI.can_dominate_mechs)