mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Fixes AI camera not working and moves can_capture_turf to the mob.
This commit is contained in:
+2
-12
@@ -871,7 +871,7 @@ arguments tx, ty, tz are target coordinates (requred), range defines render dist
|
||||
cap_mode is capturing mode (optional), user is capturing mob (requred only wehen cap_mode = CAPTURE_MODE_REGULAR),
|
||||
lighting determines lighting capturing (optional), suppress_errors suppreses errors and continues to capture (optional).
|
||||
*/
|
||||
proc/generate_image(var/tx as num, var/ty as num, var/tz as num, var/range as num, var/cap_mode = CAPTURE_MODE_PARTIAL, var/mob/user, var/lighting = 1, var/suppress_errors = 1)
|
||||
proc/generate_image(var/tx as num, var/ty as num, var/tz as num, var/range as num, var/cap_mode = CAPTURE_MODE_PARTIAL, var/mob/living/user, var/lighting = 1, var/suppress_errors = 1)
|
||||
var/list/turfstocapture = list()
|
||||
//Lines below determine what tiles will be rendered
|
||||
for(var/xoff = 0 to range)
|
||||
@@ -879,7 +879,7 @@ proc/generate_image(var/tx as num, var/ty as num, var/tz as num, var/range as nu
|
||||
var/turf/T = locate(tx + xoff,ty + yoff,tz)
|
||||
if(T)
|
||||
if(cap_mode == CAPTURE_MODE_REGULAR)
|
||||
if(can_capture_turf(T, user))
|
||||
if(user.can_capture_turf(T))
|
||||
turfstocapture.Add(T)
|
||||
continue
|
||||
else
|
||||
@@ -915,13 +915,3 @@ proc/generate_image(var/tx as num, var/ty as num, var/tz as num, var/range as nu
|
||||
|
||||
return cap
|
||||
|
||||
|
||||
proc/can_capture_turf(turf/T, mob/user) //function from photography
|
||||
var/mob/dummy = new(T) //Go go visibility check dummy
|
||||
var/viewer = user
|
||||
if(user.client) //To make shooting through security cameras possible
|
||||
viewer = user.client.eye
|
||||
var/can_see = (dummy in viewers(world.view, viewer))
|
||||
|
||||
qdel(dummy)
|
||||
return can_see
|
||||
@@ -199,17 +199,18 @@ var/global/photo_count = 0
|
||||
icon_state = icon_on
|
||||
on = 1
|
||||
|
||||
/obj/item/device/camera/proc/can_capture_turf(turf/T, mob/user)
|
||||
//Proc for capturing check
|
||||
/mob/living/proc/can_capture_turf(turf/T)
|
||||
var/mob/dummy = new(T) //Go go visibility check dummy
|
||||
var/viewer = user
|
||||
if(user.client) //To make shooting through security cameras possible
|
||||
viewer = user.client.eye
|
||||
var/viewer = src
|
||||
if(src.client) //To make shooting through security cameras possible
|
||||
viewer = src.client.eye
|
||||
var/can_see = (dummy in viewers(world.view, viewer))
|
||||
|
||||
qdel(dummy)
|
||||
return can_see
|
||||
|
||||
/obj/item/device/camera/proc/captureimage(atom/target, mob/user, flag)
|
||||
/obj/item/device/camera/proc/captureimage(atom/target, mob/living/user, flag)
|
||||
var/x_c = target.x - (size-1)/2
|
||||
var/y_c = target.y + (size-1)/2
|
||||
var/z_c = target.z
|
||||
@@ -218,7 +219,7 @@ var/global/photo_count = 0
|
||||
for(var/i = 1; i <= size; i++)
|
||||
for(var/j = 1; j <= size; j++)
|
||||
var/turf/T = locate(x_c, y_c, z_c)
|
||||
if(can_capture_turf(T, user))
|
||||
if(user.can_capture_turf(T))
|
||||
mobs += get_mobs(T)
|
||||
x_c++
|
||||
y_c--
|
||||
|
||||
@@ -69,8 +69,9 @@
|
||||
aipictures -= selection
|
||||
usr << "<span class='unconscious'>Local image deleted</span>"
|
||||
|
||||
/obj/item/device/camera/siliconcam/ai_camera/can_capture_turf(turf/T, mob/user)
|
||||
var/mob/living/silicon/ai = user
|
||||
//Capture Proc for AI / Robot
|
||||
/mob/living/silicon/ai/can_capture_turf(turf/T)
|
||||
var/mob/living/silicon/ai = src
|
||||
return ai.TurfAdjacent(T)
|
||||
|
||||
/obj/item/device/camera/siliconcam/proc/toggle_camera_mode()
|
||||
|
||||
Reference in New Issue
Block a user