Merge pull request #7426 from Miauw62/ye_olde_bugfix

fixes MMI and pAI teleporting
This commit is contained in:
hornygranny
2015-01-29 10:51:12 -08:00
4 changed files with 51 additions and 12 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ var/list/admin_verbs_admin = list(
/client/proc/Getmob, /*teleports a mob to our location*/
/client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/
// /client/proc/sendmob, /*sends a mob somewhere*/ -Removed due to it needing two sorting procs to work, which were executed every time an admin right-clicked. ~Errorage
/client/proc/Jump,
/client/proc/jumptoarea,
/client/proc/jumptokey, /*allows us to jump to the location of a mob with a certain ckey*/
/client/proc/jumptomob, /*allows us to jump to a specific mob*/
/client/proc/jumptoturf, /*allows us to jump to a specific turf*/
+31 -11
View File
@@ -1,11 +1,11 @@
/client/proc/Jump(area/A in sortedAreas)
/client/proc/jumptoarea(area/A in sortedAreas)
set name = "Jump to Area"
set desc = "Area to jump to"
set category = "Admin"
if(!src.holder)
src << "Only administrators may use this command."
return
if(!A)
return
@@ -19,8 +19,8 @@
var/turf/T = pick_n_take(turfs)
if(!T)
src << "Nowhere to jump to!"
return
usr.loc = T
return
admin_forcemove(usr, T)
log_admin("[key_name(usr)] jumped to [A]")
message_admins("[key_name_admin(usr)] jumped to [A]")
feedback_add_details("admin_verb","JA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -53,7 +53,7 @@
var/turf/T = get_turf(M)
if(T && isturf(T))
feedback_add_details("admin_verb","JM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
A.loc = T
admin_forcemove(A, M.loc)
else
A << "This mob is not located in the game world."
@@ -91,7 +91,9 @@
var/mob/M = selection:mob
log_admin("[key_name(usr)] jumped to [key_name(M)]")
message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]")
usr.loc = M.loc
admin_forcemove(usr, M.loc)
feedback_add_details("admin_verb","JK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/Getmob(var/mob/M in mob_list)
@@ -104,7 +106,7 @@
log_admin("[key_name(usr)] teleported [key_name(M)]")
message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]")
M.loc = get_turf(usr)
admin_forcemove(M, get_turf(usr))
feedback_add_details("admin_verb","GM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/Getkey()
@@ -129,7 +131,8 @@
log_admin("[key_name(usr)] teleported [key_name(M)]")
message_admins("[key_name_admin(usr)] teleported [key_name(M)]")
if(M)
M.loc = get_turf(usr)
admin_forcemove(M, get_turf(usr))
usr.loc = M.loc
feedback_add_details("admin_verb","GK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/sendmob(var/mob/M in sortmobs())
@@ -140,8 +143,25 @@
return
var/area/A = input(usr, "Pick an area.", "Pick an area") in sortedAreas
if(A)
M.loc = pick(get_area_turfs(A))
admin_forcemove(M, pick(get_area_turfs(A)))
feedback_add_details("admin_verb","SMOB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] teleported [key_name(M)] to [A]")
message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]")
message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]")
/proc/admin_forcemove(var/mob/mover, var/atom/newloc)
var/startdensity = mover.density
var/startflags = mover.pass_flags
var/startincorporeal = 0
if(istype(mover, /mob/living))
var/mob/living/L = mover
startincorporeal = L.incorporeal_move
L.incorporeal_move = 1
mover.density = 0
mover.pass_flags = ALL
newloc.density = 0
. = mover.Move(newloc)
mover.density = startdensity
mover.pass_flags = startflags
if(istype(mover, /mob/living))
var/mob/living/L = mover
L.incorporeal_move = startincorporeal