diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e4fa37f77ac..99bf21d9c5d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -550,8 +550,16 @@ its easier to just keep the beam vertical. /atom/Click(location,control,params) //world << "atom.Click() on [src] by [usr] : src.type is [src.type]" - if(!istype(src,/obj/item/weapon/gun)) + var/acting_bad = 1 //Check for gun targeting code. + if (istype(src,/obj/item/weapon/gun)) //Allow people to lower weapon + acting_bad = 0 + if (istype(src, /turf) && istype(usr,/mob/living/carbon/human)) //Allow people to turn around + var/mob/living/carbon/human/H = usr + if (!H.equipped()) + acting_bad = 0 + if(acting_bad) usr.last_target_click = world.time + if(usr.client.buildmode) build_click(usr, usr.client.buildmode, location, control, params, src) return diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index f31746de802..1945be11a65 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -135,30 +135,7 @@ if(!istype(location)) return//returns if loc is not simulated var/datum/gas_mixture/environment = location.return_air() - var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume - - var/list/current_settings = TLV["pressure"] - var/environment_pressure = environment.return_pressure() - var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings) - - current_settings = TLV["oxygen"] - var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings) - - current_settings = TLV["carbon dioxide"] - var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings) - - current_settings = TLV["plasma"] - var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, current_settings) - - current_settings = TLV["other"] - var/other_moles = 0.0 - for(var/datum/gas/G in environment.trace_gases) - other_moles+=G.moles - var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings) - - current_settings = TLV["temperature"] - var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings) - + var/temperature_dangerlevel = get_danger_level(environment.temperature, TLV["temperature"]) //Handle temperature adjustment here. if(temperature_dangerlevel || regulating_temperature) //If it goes too far, we should adjust ourselves back before stopping. @@ -194,18 +171,14 @@ "You hear a click as a faint electronic humming stops.") - var/old_danger_level = danger_level - danger_level = max(pressure_dangerlevel, - oxygen_dangerlevel, - co2_dangerlevel, - plasma_dangerlevel, - other_dangerlevel, - temperature_dangerlevel) + danger_level = overall_danger_level() + log_debug("Processing [name] : level - [danger_level]") - if (old_danger_level != danger_level) - apply_danger_level(danger_level) + if (alarm_area.master_air_alarm == src) + refresh_danger_level() + update_icon() - if (mode==AALARM_MODE_CYCLE && environment_pressure level) + level = AA.danger_level + apply_danger_level(level) + proc/air_doors_close(manual) var/area/A = get_area(src) if(!A.master.air_doors_activated) diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index 5480b83d847..6507a2f66a1 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -25,6 +25,13 @@ user.client.remove_gun_icons() return ..() +/obj/item/weapon/gun/equipped(var/mob/user, var/slot) + if (slot != slot_l_hand && slot != slot_r_hand) + stop_aim() + if (user.client) + user.client.remove_gun_icons() + return ..() + //Removes lock fro mall targets /obj/item/weapon/gun/proc/stop_aim() if(target) @@ -69,6 +76,7 @@ if(!istype(M)) return if(src != M.equipped()) stop_aim() + return M.last_move_intent = world.time if(load_into_chamber()) var/firing_check = in_chamber.check_fire(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing. @@ -155,7 +163,7 @@ mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory. targeted_by += I I.lock_time = world.time + 20 //Target has 2 second to realize they're targeted and stop (or target the opponent). src << "((\red Your character is being targeted. They have 2 seconds to stop any click or move actions. \black While targeted, they may \ - drag and drop items in or into the map, speak, and click on interface buttons. Clicking on the map, their items \ + drag and drop items in or into the map, speak, and click on interface buttons. Clicking on the map objects (floors and walls are fine), their items \ (other than a weapon to de-target), or moving will result in being fired upon. \red The aggressor may also fire manually, \ so try not to get on their bad side.\black ))"