mirror of
https://github.com/cybergirlvannie/OpenSS13.git
synced 2026-07-12 16:22:42 +01:00
Added the patch ai_area_selection.patch by both Stephen001 and Kurper
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/proc/get_area(area/A)
|
||||
while(!istype(A, /area) && A)
|
||||
A = A.loc
|
||||
return A
|
||||
|
||||
|
||||
/var/const/INFINITY = 1e20 //close enough
|
||||
|
||||
/turf/DblClick()
|
||||
if(usr.stat || !istype(usr, /mob/ai))
|
||||
return ..()
|
||||
if (world.time <= usr:lastDblClick+2)
|
||||
return ..()
|
||||
|
||||
//try to find the closest working camera in the same area, switch to it
|
||||
var/area/A = get_area(src)
|
||||
var/best_dist = INFINITY
|
||||
var/best_cam = null
|
||||
for(var/obj/machinery/camera/C in A)
|
||||
if(usr:network != C.network)
|
||||
continue // different network (syndicate)
|
||||
if(C.z != usr.z)
|
||||
continue // different viewing plane
|
||||
if(!C.status)
|
||||
continue // ignore disabled cameras
|
||||
var/dist = get_dist(src, C)
|
||||
if(dist < best_dist)
|
||||
best_dist = dist
|
||||
best_cam = C
|
||||
|
||||
if(!best_cam)
|
||||
return ..()
|
||||
usr:lastDblClick = world.time
|
||||
usr:current = best_cam
|
||||
usr:reset_view(best_cam)
|
||||
usr:cameraFollow = null
|
||||
+1
-2
@@ -6,7 +6,6 @@
|
||||
/*
|
||||
FILE: ss13h_new.dmp
|
||||
DIR: Code Code\Effects Code\Item Code\Item\Weapon Code\Machinery Code\Machinery\Computer
|
||||
UPDATE_OBJ_TREE: ON
|
||||
MAP_ICON_TYPE: 0
|
||||
AUTO_FILE_DIR: ON
|
||||
*/
|
||||
@@ -14,7 +13,6 @@ AUTO_FILE_DIR: ON
|
||||
// BEGIN_FILE_DIR
|
||||
#define FILE_DIR .
|
||||
#define FILE_DIR "Code"
|
||||
#define FILE_DIR "Code/Admin"
|
||||
#define FILE_DIR "Code/CTF"
|
||||
#define FILE_DIR "Code/Effects"
|
||||
#define FILE_DIR "Code/Item"
|
||||
@@ -37,6 +35,7 @@ AUTO_FILE_DIR: ON
|
||||
#include "ss13h_new.dmp"
|
||||
#include "Code\!atoms.dm"
|
||||
#include "Code\aaaDefines.dm"
|
||||
#include "Code\ai_area_selection.dm"
|
||||
#include "Code\airtunnel.dm"
|
||||
#include "Code\areas.dm"
|
||||
#include "Code\blob.dm"
|
||||
|
||||
Reference in New Issue
Block a user