Ports "[s] Fixes pride mirror exploit"
This commit is contained in:
@@ -114,8 +114,9 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
|
||||
|
||||
#define TRANSITIONEDGE 7 //Distance from edge to move to another z-level
|
||||
|
||||
#define BE_CLOSE 1 //in the case of a silicon, to select if they need to be next to the atom
|
||||
#define NO_DEXTERY 1 //if other mobs (monkeys, aliens, etc) can use this
|
||||
#define BE_CLOSE TRUE //in the case of a silicon, to select if they need to be next to the atom
|
||||
#define NO_DEXTERY TRUE //if other mobs (monkeys, aliens, etc) can use this
|
||||
#define NO_TK TRUE
|
||||
//used by canUseTopic()
|
||||
|
||||
//singularity defines
|
||||
|
||||
@@ -171,7 +171,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
overlay.icon_state = "pai_off_overlay"
|
||||
add_overlay(new /mutable_appearance(overlay))
|
||||
|
||||
/obj/item/pda/MouseDrop(obj/over_object, src_location, over_location)
|
||||
/obj/item/pda/MouseDrop(mob/over, src_location, over_location)
|
||||
var/mob/M = usr
|
||||
if((M == over) && usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return attack_self(M)
|
||||
|
||||
@@ -24,15 +24,13 @@
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
var/userloc = H.loc
|
||||
|
||||
//see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments!
|
||||
//this is largely copypasted from there.
|
||||
|
||||
//handle facial hair (if necessary)
|
||||
if(H.gender == MALE)
|
||||
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list
|
||||
if(userloc != H.loc)
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return //no tele-grooming
|
||||
if(new_style)
|
||||
H.facial_hair_style = new_style
|
||||
@@ -41,7 +39,7 @@
|
||||
|
||||
//handle normal hair
|
||||
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list
|
||||
if(userloc != H.loc)
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return //no tele-grooming
|
||||
if(new_style)
|
||||
H.hair_style = new_style
|
||||
@@ -90,9 +88,9 @@
|
||||
/obj/structure/mirror/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
if(BURN)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
|
||||
|
||||
/obj/structure/mirror/magic
|
||||
@@ -131,7 +129,7 @@
|
||||
|
||||
var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes")
|
||||
|
||||
if(!Adjacent(user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
|
||||
switch(choice)
|
||||
@@ -140,7 +138,7 @@
|
||||
|
||||
if(!newname)
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
H.real_name = newname
|
||||
H.name = newname
|
||||
@@ -156,7 +154,7 @@
|
||||
|
||||
if(!newrace)
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
H.set_species(newrace, icon_update=0)
|
||||
|
||||
@@ -186,7 +184,7 @@
|
||||
if("gender")
|
||||
if(!(H.gender in list("male", "female"))) //blame the patriarchy
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
if(H.gender == "male")
|
||||
if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes")
|
||||
@@ -207,7 +205,7 @@
|
||||
|
||||
if("hair")
|
||||
var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color")
|
||||
if(!Adjacent(user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
if(hairchoice == "Style") //So you just want to use a mirror then?
|
||||
..()
|
||||
@@ -225,7 +223,7 @@
|
||||
|
||||
if(BODY_ZONE_PRECISE_EYES)
|
||||
var/new_eye_color = input(H, "Choose your eye color", "Eye Color","#"+H.eye_color) as color|null
|
||||
if(!Adjacent(user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
if(new_eye_color)
|
||||
H.eye_color = sanitize_hexcolor(new_eye_color)
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
visible_message("<span class='warning'>[src] easily breaks out of [p_their()] handcuffs!</span>", \
|
||||
"<span class='notice'>With just a thought your handcuffs fall off.</span>")
|
||||
|
||||
/mob/living/carbon/true_devil/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/carbon/true_devil/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -753,7 +753,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
update_icon()
|
||||
|
||||
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
return IsAdminGhost(usr)
|
||||
|
||||
/mob/dead/observer/is_literate()
|
||||
|
||||
@@ -724,12 +724,12 @@
|
||||
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#000000")
|
||||
cut_overlay(MA)
|
||||
|
||||
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated() || lying )
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
if(!Adjacent(M) && (M.loc != src))
|
||||
if((be_close == 0) || (dna.check_mutation(TK) && tkMaxRangeCheck(src, M)))
|
||||
if((be_close == 0) || (!no_tk && (dna.check_mutation(TK) && tkMaxRangeCheck(src, M))))
|
||||
return TRUE
|
||||
to_chat(src, "<span class='warning'>You are too far away!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -814,7 +814,7 @@
|
||||
/mob/living/proc/harvest(mob/living/user) //used for extra objects etc. in butchering
|
||||
return
|
||||
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -779,7 +779,7 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/silicon/ai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(control_disabled || incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
// See software.dm for Topic()
|
||||
|
||||
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(be_close && !in_range(M, src))
|
||||
to_chat(src, "<span class='warning'>You are too far away!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -910,7 +910,7 @@
|
||||
if(DISCONNECT) //Tampering with the wires
|
||||
to_chat(connected_ai, "<br><br><span class='notice'>NOTICE - Remote telemetry lost with [name].</span><br>")
|
||||
|
||||
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(stat || lockcharge || low_power_mode)
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -392,7 +392,7 @@
|
||||
if(target)
|
||||
return new childspawn(target)
|
||||
|
||||
/mob/living/simple_animal/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/simple_animal/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -784,7 +784,7 @@
|
||||
return 0
|
||||
|
||||
//Can the mob use Topic to interact with machines
|
||||
/mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
return
|
||||
|
||||
/mob/proc/faction_check_mob(mob/target, exact_match)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
return machinery_computer.update_icon()
|
||||
|
||||
// This thing is not meant to be used on it's own, get topic data from our machinery owner.
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
// if(!machinery_computer)
|
||||
// return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user