diff --git a/aurorastation.dme b/aurorastation.dme index 41d1f55b791..2065d437fbd 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -2164,10 +2164,6 @@ #include "code\modules\mob\abstract\observer\observer.dm" #include "code\modules\mob\abstract\observer\say.dm" #include "code\modules\mob\abstract\unauthed\login.dm" -#include "code\modules\mob\abstract\virtual\_constants.dm" -#include "code\modules\mob\abstract\virtual\base.dm" -#include "code\modules\mob\abstract\virtual\helpers.dm" -#include "code\modules\mob\abstract\virtual\mob.dm" #include "code\modules\mob\language\generic.dm" #include "code\modules\mob\language\language.dm" #include "code\modules\mob\language\monkey.dm" diff --git a/code/controllers/subsystems/spatial_gridmap.dm b/code/controllers/subsystems/spatial_gridmap.dm index 3707cf02946..ce454a84e74 100644 --- a/code/controllers/subsystems/spatial_gridmap.dm +++ b/code/controllers/subsystems/spatial_gridmap.dm @@ -356,9 +356,6 @@ ///find the spatial map cell that target belongs to, then add target's important_recusive_contents to it. ///make sure to provide the turf new_target is "in" /datum/controller/subsystem/spatial_grid/proc/enter_cell(atom/movable/new_target, turf/target_turf) - if(init_state != SS_INITSTATE_DONE) - return - if(QDELETED(new_target)) CRASH("qdeleted or null target trying to enter the spatial grid!") diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 3ce69eb3164..fc7e8f6abc8 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -61,10 +61,6 @@ if (bound_overlay) QDEL_NULL(bound_overlay) - if(virtual_mob && !ispath(virtual_mob)) - qdel(virtual_mob) - virtual_mob = null - // This is called when this atom is prevented from moving by atom/A. /atom/movable/proc/Collide(atom/A) if(airflow_speed > 0 && airflow_dest) diff --git a/code/game/machinery/telecomms/broadcasting.dm b/code/game/machinery/telecomms/broadcasting.dm index 4854c0e3ed4..7407521a357 100644 --- a/code/game/machinery/telecomms/broadcasting.dm +++ b/code/game/machinery/telecomms/broadcasting.dm @@ -118,7 +118,7 @@ var/mob/M = speaker.resolve() data = list( - "name" = M.name, + "name" = M.GetVoice(), "job" = M.job, "message" = message, "compression" = rand(35, 65), diff --git a/code/modules/mob/abstract/new_player/new_player.dm b/code/modules/mob/abstract/new_player/new_player.dm index 4eb75a680b1..4e773ab2d18 100644 --- a/code/modules/mob/abstract/new_player/new_player.dm +++ b/code/modules/mob/abstract/new_player/new_player.dm @@ -14,7 +14,6 @@ anchored = 1 // don't get pushed around simulated = FALSE - virtual_mob = null // Hear no evil, speak no evil var/last_ready_name // This has to be saved because the client is nulled prior to Logout() diff --git a/code/modules/mob/abstract/virtual/_constants.dm b/code/modules/mob/abstract/virtual/_constants.dm deleted file mode 100644 index e999193fb34..00000000000 --- a/code/modules/mob/abstract/virtual/_constants.dm +++ /dev/null @@ -1,4 +0,0 @@ -var/global/const/VIRTUAL_ABILITY_NONE = 0 -var/global/const/VIRTUAL_ABILITY_HEAR = 1 -var/global/const/VIRTUAL_ABILITY_SEE = 2 -var/global/const/VIRTUAL_ABILITY_ALL = (~VIRTUAL_ABILITY_NONE) \ No newline at end of file diff --git a/code/modules/mob/abstract/virtual/base.dm b/code/modules/mob/abstract/virtual/base.dm deleted file mode 100644 index 9b51551ca49..00000000000 --- a/code/modules/mob/abstract/virtual/base.dm +++ /dev/null @@ -1,71 +0,0 @@ -// -// Virtual Mob -// - -var/global/list/all_virtual_listeners = list() - -/mob/abstract/observer/virtual - icon = 'icons/mob/abstract/virtual.dmi' - invisibility = INVISIBILITY_SYSTEM - see_in_dark = SEE_IN_DARK_DEFAULT - see_invisible = SEE_INVISIBLE_LIVING - sight = SEE_SELF - - virtual_mob = null - no_z_overlay = TRUE - - should_add_to_mob_list = FALSE - - var/atom/movable/host - var/host_type = /atom/movable - var/abilities = VIRTUAL_ABILITY_HEAR|VIRTUAL_ABILITY_SEE - var/list/broadcast_methods - - var/static/list/overlay_icons - -/mob/abstract/observer/virtual/New(var/location, var/atom/movable/host) - ..() - if(!istype(host, host_type)) - CRASH("Received an unexpected host type. Expected [host_type], was [log_info_line(host)].") - src.host = host - moved_event.register(host, src, /atom/movable/proc/move_to_turf_or_null) - - all_virtual_listeners += src - - update_icon() - -/mob/abstract/observer/virtual/Initialize() - . = ..() - STOP_PROCESSING(SSmob, src) - -/mob/abstract/observer/virtual/Destroy() - moved_event.unregister(host, src, /atom/movable/proc/move_to_turf_or_null) - all_virtual_listeners -= src - host = null - return ..() - -/mob/abstract/observer/virtual/update_icon() - if(!overlay_icons) - overlay_icons = list() - for(var/i_state in icon_states(icon)) - overlay_icons[i_state] = image(icon = icon, icon_state = i_state) - overlays.Cut() - - if(abilities & VIRTUAL_ABILITY_HEAR) - overlays += overlay_icons["hear"] - if(abilities & VIRTUAL_ABILITY_SEE) - overlays += overlay_icons["see"] - -// -// Virtual Mob Creation -// -/atom/movable - var/mob/abstract/observer/virtual/virtual_mob - -/atom/movable/Initialize() - . = ..() - if(shall_have_virtual_mob()) - virtual_mob = new virtual_mob(get_turf(src), src) - -/atom/movable/proc/shall_have_virtual_mob() - return ispath(initial(virtual_mob)) \ No newline at end of file diff --git a/code/modules/mob/abstract/virtual/helpers.dm b/code/modules/mob/abstract/virtual/helpers.dm deleted file mode 100644 index 8503a23b9f6..00000000000 --- a/code/modules/mob/abstract/virtual/helpers.dm +++ /dev/null @@ -1,103 +0,0 @@ -/* -* These calls could easily be setup to be a bunch of call()() with relevant procs and predicates but performance is a concern. -* BYOND is also a bit inflexible, as some predicates are of the sort /proc/name(host), others host.proc_name(), and some even do host.proc_name(parameter). -* Nothing that cannot be worked around, but it'd be a little messy. I miss C# lambdas... -*/ - -// Procs are arranged by "in range/hearers/viewers()" usage, as opposed to virtual mob hear/see abilities. -// Most of these procs can technically take any movable atom but unless they have a virtual mob the returned objects may not be the expected ones - -#define ACQUIRE_VIRTUAL_OR_TURF(A) A = (isvirtualmob(A) ? A : (((istype(A) && A.virtual_mob) ? A.virtual_mob : get_turf(A)))) ; if(!A) return -#define ACQUIRE_VIRTUAL_OR_RETURN(A) A = (isvirtualmob(A) ? A : (((istype(A) && A.virtual_mob) ? A.virtual_mob : null))) ; if(!A) return - -/**************** -* Range Helpers * -****************/ -/proc/clients_in_range(var/atom/movable/center_vmob) - . = list() - - ACQUIRE_VIRTUAL_OR_TURF(center_vmob) - for(var/mob/abstract/observer/virtual/v_mob in range(world.view, center_vmob)) - var/client/C = v_mob.get_client() - if(C) - . |= C - -/proc/hearers_in_range(var/atom/movable/center_vmob, var/hearing_range = world.view) - . = list() - - ACQUIRE_VIRTUAL_OR_TURF(center_vmob) - for(var/mob/abstract/observer/virtual/v_mob in range(hearing_range, center_vmob)) - if(v_mob.abilities & VIRTUAL_ABILITY_HEAR) - . |= v_mob.host - -/proc/viewers_in_range(var/atom/movable/center_vmob) - . = list() - - ACQUIRE_VIRTUAL_OR_TURF(center_vmob) - for(var/mob/abstract/observer/virtual/v_mob in range(world.view, center_vmob)) - if(v_mob.abilities & VIRTUAL_ABILITY_SEE) - . |= v_mob.host - -/*************** -* Hear Helpers * -***************/ -// A mob hears another mob if they have direct line of sight, ignoring turf luminosity. -// If there is an opaque object beteween the mobs then they cannot hear each other, even if their respective turfs can be seen. -// Thus, unlike viewing hearing is communicative. I.e. if Mob A can hear Mob B then Mob B can also hear Mob A. - -// Gets the hosts of all the virtual mobs that can hear the given movable atom (or rather, it's virtual mob or turf in that existence order) -/proc/all_hearers(var/atom/movable/heard_vmob, var/range = world.view) - . = list() - - ACQUIRE_VIRTUAL_OR_TURF(heard_vmob) - for(var/mob/abstract/observer/virtual/v_mob in hearers(range, heard_vmob)) - if(v_mob.abilities & VIRTUAL_ABILITY_HEAR) - . |= v_mob.host - -/*************** -* View Helpers * -***************/ -// A mob can see another mob if: -// * Within visual range, with the following differences for (N)PCs. -// * PCs: Target is within client.view range, with center originating from either the mob or client.eye depending on client.eye_perspective. -// * NPCs: Target is within world.view range, with center always originating from the mob. -// * Either of the following is true: -// * The target mob is in direct line of sight and not standing on a turf with luminosity = 0 unless the viewing mob is close enough for see_in_dark to also be in range -// * The viewing mob has the SEE_MOBS sight flag. - -// Gets the hosts of all virtual mobs that can see the given atom movable as well as its turf -/proc/all_viewers(var/mob/abstract/observer/virtual/viewed_atom) - . = list() - - viewed_atom = istype(viewed_atom) ? viewed_atom.host : viewed_atom - var/turf/T = get_turf(viewed_atom) - if(!T) - return - - for(var/mob/abstract/observer/virtual/seeing_v_mob in viewers(world.view, viewed_atom)) - if(!(seeing_v_mob.abilities & VIRTUAL_ABILITY_SEE)) - continue - var/atom/movable/host = seeing_v_mob.host - if(host.virtual_can_see_turf(T)) - . |= host - -// This proc returns all hosts of virtual mobs in the given atom's view range (using its turf), ignoring invisibility, VIRUAL_ABILITY_SEE, and most other restrictions. -// In most cases you actually want the all_* procs above. This helper was designed with LOOC in mind. -/proc/hosts_in_view_range(var/atom/movable/viewing_atom, var/range = world.view) - . = list() - - ACQUIRE_VIRTUAL_OR_TURF(viewing_atom) - // As per http://www.byond.com/docs/ref/info.html#/proc/view by using a non-mob/client this automatically skips the vast majority of sight checks - for(var/mob/abstract/observer/virtual/v_mob in viewers(range, get_turf(viewing_atom.loc))) - . |= v_mob.host - -/* - Misc. helper -*/ - -// Eye mobs technically see everything always, the owner just has an overlay applied, thus this helper -/atom/movable/proc/virtual_can_see_turf(var/turf/T) - return TRUE // We assume objects have already been filtered using viewers() or similar proc - -#undef ACQUIRE_VIRTUAL_OR_TURF -#undef ACQUIRE_VIRTUAL_OR_RETURN diff --git a/code/modules/mob/abstract/virtual/mob.dm b/code/modules/mob/abstract/virtual/mob.dm deleted file mode 100644 index 6d1702750bf..00000000000 --- a/code/modules/mob/abstract/virtual/mob.dm +++ /dev/null @@ -1,22 +0,0 @@ -/mob/abstract/observer/virtual/mob - host_type = /mob - -/mob/abstract/observer/virtual/mob/New(var/location, var/mob/host) - ..() - - sight_set_event.register(host, src, /mob/abstract/observer/virtual/mob/proc/sync_sight) - see_invisible_set_event.register(host, src, /mob/abstract/observer/virtual/mob/proc/sync_sight) - see_in_dark_set_event.register(host, src, /mob/abstract/observer/virtual/mob/proc/sync_sight) - - sync_sight(host) - -/mob/abstract/observer/virtual/mob/Destroy() - sight_set_event.unregister(host, src, /mob/abstract/observer/virtual/mob/proc/sync_sight) - see_invisible_set_event.unregister(host, src, /mob/abstract/observer/virtual/mob/proc/sync_sight) - see_in_dark_set_event.unregister(host, src, /mob/abstract/observer/virtual/mob/proc/sync_sight) - . = ..() - -/mob/abstract/observer/virtual/mob/proc/sync_sight(var/mob/mob_host) - sight = mob_host.sight - see_invisible = mob_host.see_invisible - see_in_dark = mob_host.see_in_dark \ No newline at end of file diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index dfddfa9dfa1..0fe9981ddab 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -165,7 +165,7 @@ else speaker_name = "Unknown" - if(ishuman(speaker) && speaker.GetVoice() != real_name) + if(ishuman(speaker)) speaker_name = speaker.GetVoice() if(hard_to_hear) diff --git a/code/modules/mob/living/carbon/human/human_species.dm b/code/modules/mob/living/carbon/human/human_species.dm index deaf8431755..25107161283 100644 --- a/code/modules/mob/living/carbon/human/human_species.dm +++ b/code/modules/mob/living/carbon/human/human_species.dm @@ -1,7 +1,6 @@ /mob/living/carbon/human/dummy real_name = "Test Dummy" status_flags = GODMODE|CANPUSH - virtual_mob = null /mob/living/carbon/human/dummy/mannequin mob_thinks = FALSE diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 30230f2502f..8a6f4d63fa7 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -4,7 +4,6 @@ animate_movement = 2 flags = PROXMOVE sight = DEFAULT_SIGHT - virtual_mob = /mob/abstract/observer/virtual/mob var/datum/mind/mind var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 106786333af..c929addead7 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1292,6 +1292,3 @@ proc/is_blind(A) /mob/get_client() return client - -/mob/abstract/observer/virtual/get_client() - return host.get_client() diff --git a/html/changelogs/johnwildkins-fixhear.yml b/html/changelogs/johnwildkins-fixhear.yml new file mode 100644 index 00000000000..a0a916f80ff --- /dev/null +++ b/html/changelogs/johnwildkins-fixhear.yml @@ -0,0 +1,8 @@ +author: JohnWildkins + +delete-after: True + +changes: + - bugfix: "Fixed mapped-in mobs (namely animals like Columbo) not being added to the hearables grid properly, thus acting deaf." + - bugfix: "Fixed an issue where voice mimic / masking wouldn't be respected by tcomms logging." + - backend: "Removed virtual mobs implementation in favor of the spatial grid system, as the two conflict."