mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 20:20:33 +01:00
[NO GBP] Fixes AI Camera mode being limited by range (#95741)
## About The Pull Request - Fixes #95738 ## Changelog 🆑 fix: AI camera mode works from any distances /🆑
This commit is contained in:
@@ -137,6 +137,7 @@
|
||||
to_chat(user, span_notice("The dimensions of the picture will be [EXAMINE_HINT("[APERTURE_TO_METERS(picture_size_x)]x[APERTURE_TO_METERS(picture_size_y)]")]"))
|
||||
|
||||
return TRUE
|
||||
|
||||
/// Resets flash to be used again
|
||||
/obj/item/camera/proc/cooldown()
|
||||
PRIVATE_PROC(TRUE)
|
||||
@@ -211,21 +212,21 @@
|
||||
|
||||
//Checking if we can target
|
||||
var/turf/target_turf = get_turf(target)
|
||||
var/view_size = user?.client?.view || world.view
|
||||
if(isnull(target_turf))
|
||||
return
|
||||
if(isAI(user) && !SScameras.is_visible_by_cameras(target_turf))
|
||||
return
|
||||
if(isliving(loc) && !(target_turf in view(world.view, loc)))
|
||||
return
|
||||
if(!(target_turf in view(world.view, user || src)))
|
||||
if(isAI(user))
|
||||
if(!SScameras.is_visible_by_cameras(target_turf))
|
||||
return
|
||||
else if(!(target_turf in view(view_size, user)))
|
||||
return
|
||||
|
||||
//These vars will be reused later on
|
||||
var/size_x = picture_size_x - 1
|
||||
var/size_y = picture_size_y - 1
|
||||
var/list/viewlist = getviewsize(user?.client?.view || world.view)
|
||||
var/list/viewlist = getviewsize(view_size)
|
||||
var/view_range = max(viewlist[1], viewlist[2]) + max(size_x, size_y)
|
||||
var/viewer = get_turf(user?.client?.eye || user || target) // not sure why target is a fallback
|
||||
var/viewer = get_turf(user?.client?.eye || user)
|
||||
var/list/seen = get_hear_turfs(view_range, viewer)
|
||||
if(!(target_turf in seen))
|
||||
return
|
||||
@@ -286,7 +287,7 @@
|
||||
continue
|
||||
names += "[person.name]"
|
||||
|
||||
var/datum/picture/picture = new("picture", desc.Join("<br>"), mobs_spotted, dead_spotted, names, get_icon, null, width * ICON_SIZE_X, height * ICON_SIZE_X, blueprints, can_see_ghosts = see_ghosts)
|
||||
var/datum/picture/picture = new("picture", desc.Join("<br>"), mobs_spotted, dead_spotted, names, get_icon, null, width * ICON_SIZE_X, height * ICON_SIZE_Y, blueprints, can_see_ghosts = see_ghosts)
|
||||
after_picture(user, picture)
|
||||
SEND_SIGNAL(src, COMSIG_CAMERA_IMAGE_CAPTURED, target, user, picture)
|
||||
blending = FALSE
|
||||
|
||||
Reference in New Issue
Block a user