Added the patch ai_area_selection.patch by both Stephen001 and Kurper

This commit is contained in:
zjm7891
2008-07-24 01:17:55 +00:00
parent 414228d020
commit 0d957161fb
2 changed files with 37 additions and 2 deletions
+36
View File
@@ -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
View File
@@ -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"