@@ -27,6 +27,8 @@ Call proc /mob/proc/Dizzy() for some player
27
27
Because if you select a player mob as owner it tries to do the proc for
28
28
/mob/living/carbon/human/ instead. And that gives a run-time error.
29
29
But you can call procs that are of type /mob/living/carbon/human/proc/ for that player.
30
+ 14th oct 2024
31
+ now actually filters to a type, redundant procs cut down
30
32
*/
31
33
32
34
/ client / proc / calladvproc()
@@ -39,30 +41,23 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
39
41
var /target = null
40
42
var /class = null
41
43
42
- switch (alert(" Proc owned by something?" ,," Yes" ," No" ))
43
- if (" Yes" )
44
- class = input (" Proc owned by..." ," Owner" ,null ) as null | anything in list (" Obj" ," Mob" ," Area or Turf" ," Client" )
45
- if (! class)
46
- return
47
-
48
- var /list /stufftocall = list ()
49
- if (class == " Client" )
50
- for (var /client /C in clients)
51
- stufftocall += C
52
- else if (class == " Mob" )
53
- stufftocall = mob_list
54
- else
55
- for (var /atom /A in world )
56
- if (class == " Obj" )
57
- if (isobj(A))
58
- stufftocall += A
59
- else if (class == " Area or Turf" )
60
- if (isarea(A) || isturf(A))
61
- stufftocall += A
62
- IN_ROUND_CHECK_TICK // bam. now it doesn't freeze the game anymore
63
- target = input (" Enter target" , " Target:" , class == " Area or Turf" ? usr . loc : usr , null ) as null | anything in stufftocall
64
- if (! target)
65
- return
44
+ if (alert(" Proc owned by something?" ," Proc call" ," Yes" ," No" ) == " Yes" )
45
+ class = input (" Proc owned by what type of atom? (eg. /obj/machinery)" ," Owner" ,null ) as text
46
+ if (! class)
47
+ return
48
+ class = filter_typelist_input(" Select an atom type" , " Spawn Atom" , get_matching_types(class, / atom ))
49
+
50
+ var /list /stufftocall = list ()
51
+ if (class == " /client" )
52
+ stufftocall = clients
53
+ else
54
+ for (var /atom /A in world )
55
+ if (istype(A,class))
56
+ stufftocall |= A
57
+ IN_ROUND_CHECK_TICK // bam. now it doesn't freeze the game anymore
58
+ target = input (" Enter target" , " Target:" , ispath(class,/ area ) || ispath(class,/ turf ) ? usr . loc : usr , null ) as null | anything in stufftocall
59
+ if (! target)
60
+ return
66
61
67
62
callproc (usr ,target)
68
63
feedback_add_details (" admin_verb" ," APC" ) // If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
0 commit comments