Skip to content

Commit 93bb6d2

Browse files
authored
bugfix: ИИ работает с голомапом теперь (#6510)
* bugfix: ИИ работает с голомапом теперь * fix
1 parent a56df78 commit 93bb6d2

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

_maps/map_files/Delta/delta.dmm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28027,7 +28027,7 @@
2802728027
network = list("Engineering","SS13");
2802828028
pixel_y = -22
2802928029
},
28030-
/obj/machinery/station_map/engineering/directional/west,
28030+
/obj/machinery/station_map/engineering/directional/south,
2803128031
/turf/simulated/floor/plasteel{
2803228032
dir = 8;
2803328033
icon_state = "yellow"

code/__DEFINES/dcs/signals_silicon.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
///from base of /mob/camera/aiEye/setLoc: (/turf/destination)
2+
#define COMSIG_AI_EYE_MOVED "ai_eye_moved"

code/modules/holomaps/machinery.dm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
/// The mob beholding this marvel.
2121
var/mob/watching_mob
22+
/// The mob we're looking after if moved. Used by AI eye only.
23+
var/mob/moving_mob
2224
/// The image that can be seen in-world.
2325
var/image/small_station_map
2426
/// The little "map" floor painting.
@@ -101,8 +103,12 @@
101103
var/datum/hud/human/user_hud = user.hud_used
102104
holomap_datum.base_map.loc = user_hud.holomap // Put the image on the holomap hud
103105
holomap_datum.base_map.alpha = 0 // Set to transparent so we can fade in
104-
105-
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(check_position))
106+
if(isAI(user))
107+
var/mob/living/silicon/ai/our_ai = user
108+
moving_mob = our_ai.eyeobj
109+
RegisterSignal(moving_mob, COMSIG_AI_EYE_MOVED, PROC_REF(check_position))
110+
else
111+
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(check_position))
106112

107113
playsound(src, 'sound/effects/holomap_open.ogg', 125)
108114
animate(holomap_datum.base_map, alpha = 255, time = 5, easing = LINEAR_EASING)
@@ -135,16 +141,17 @@
135141
if((stat & (NOPOWER | BROKEN)) || !anchored)
136142
close_map()
137143

138-
/obj/machinery/station_map/proc/check_position()
144+
/obj/machinery/station_map/proc/check_position(mob/moved_mob)
139145
SIGNAL_HANDLER
140146

141-
if(!watching_mob || (watching_mob.loc != loc) || (dir != watching_mob.dir))
147+
if(!moved_mob || (moved_mob.loc != loc) || (dir != moved_mob.dir))
142148
close_map()
143149

144150
/obj/machinery/station_map/proc/close_map()
145151
if(!watching_mob)
146152
return
147153

154+
UnregisterSignal(moving_mob, COMSIG_AI_EYE_MOVED)
148155
UnregisterSignal(watching_mob, COMSIG_MOVABLE_MOVED)
149156
playsound(src, 'sound/effects/holomap_close.ogg', 125)
150157
icon_state = initial(icon_state)

code/modules/mob/living/silicon/ai/freelook/eye.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
if(!force_update && (destination == get_turf(src)))
4242
return //we are already here!
4343
abstract_move(destination)
44+
SEND_SIGNAL(src, COMSIG_AI_EYE_MOVED, destination)
4445
if(use_static)
4546
ai.camera_visibility(src)
4647
if(ai.client)

paradise.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
#include "code\__DEFINES\dcs\signals_blob.dm"
167167
#include "code\__DEFINES\dcs\signals_lazy_templates.dm"
168168
#include "code\__DEFINES\dcs\signals_object.dm"
169+
#include "code\__DEFINES\dcs\signals_silicon.dm"
169170
#include "code\__DEFINES\dcs\signals_turf.dm"
170171
#include "code\__DEFINES\traits\_traits.dm"
171172
#include "code\__DEFINES\traits\declarations.dm"

0 commit comments

Comments
 (0)