Merge pull request #26049 from Shadowlight213/dequipoverride

Fixes Chinese cartoons button causing stuff in pockets to drop
This commit is contained in:
Jordie
2017-04-11 16:43:10 +10:00
committed by GitHub
4 changed files with 36 additions and 21 deletions
+18 -5
View File
@@ -421,6 +421,14 @@
if("anime")
if(!check_rights(R_FUN))
return
var/animetype = alert("Would you like to have the clothes be changed?",,"Yes","No","Cancel")
var/droptype
if(animetype =="Yes")
droptype = alert("Make the uniforms Nodrop?",,"Yes","No","Cancel")
if(animetype == "Cancel" || droptype == "Cancel")
return
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","CC")
message_admins("[key_name_admin(usr)] made everything kawaii.")
@@ -431,16 +439,21 @@
if(H.dna.features["tail_human"] == "None" || H.dna.features["ears"] == "None")
H.dna.features["tail_human"] = "Cat"
H.dna.features["ears"] = "Cat"
var/seifuku = pick(typesof(/obj/item/clothing/under/schoolgirl))
var/obj/item/clothing/under/schoolgirl/I = new seifuku
var/list/honorifics = list("[MALE]" = list("kun"), "[FEMALE]" = list("chan","tan"), "[NEUTER]" = list("san")) //John Robust -> Robust-kun
var/list/names = splittext(H.real_name," ")
var/forename = names.len > 1 ? names[2] : names[1]
var/newname = "[forename]-[pick(honorifics["[H.gender]"])]"
H.fully_replace_character_name(H.real_name,newname)
H.temporarilyRemoveItemFromInventory(H.w_uniform, TRUE)
H.equip_to_slot_or_del(I, slot_w_uniform)
I.flags |= NODROP
H.update_mutant_bodyparts()
if(animetype == "Yes")
var/seifuku = pick(typesof(/obj/item/clothing/under/schoolgirl))
var/obj/item/clothing/under/schoolgirl/I = new seifuku
var/olduniform = H.w_uniform
H.temporarilyRemoveItemFromInventory(H.w_uniform, TRUE, FALSE)
H.equip_to_slot_or_del(I, slot_w_uniform)
qdel(olduniform)
if(droptype == "Yes")
I.flags |= NODROP
else
to_chat(H, "You're not kawaii enough for this.")
+4 -3
View File
@@ -280,14 +280,15 @@
//visibly unequips I but it is NOT MOVED AND REMAINS IN SRC
//item MUST BE FORCEMOVE'D OR QDEL'D
/mob/proc/temporarilyRemoveItemFromInventory(obj/item/I, force = FALSE)
return doUnEquip(I, force, null, TRUE)
/mob/proc/temporarilyRemoveItemFromInventory(obj/item/I, force = FALSE, idrop = TRUE)
return doUnEquip(I, force, null, TRUE, idrop)
//DO NOT CALL THIS PROC
//use one of the above 2 helper procs
//you may override it, but do not modify the args
/mob/proc/doUnEquip(obj/item/I, force, newloc, no_move) //Force overrides NODROP for things like wizarditis and admin undress.
/mob/proc/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) //Force overrides NODROP for things like wizarditis and admin undress.
//Use no_move if the item is just gonna be immediately moved afterward
//Invdrop is used to prevent stuff in pockets dropping. only set to false if it's going to immediately be replaced
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
return TRUE
@@ -141,13 +141,13 @@
return not_handled //For future deeper overrides
/mob/living/carbon/human/doUnEquip(obj/item/I, force)
/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
if(I == wear_suit)
if(s_store)
if(s_store && invdrop)
dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit.
if(wear_suit.breakouttime) //when unequipping a straightjacket
update_action_buttons_icon() //certain action buttons may be usable again.
@@ -156,17 +156,18 @@
update_inv_w_uniform()
update_inv_wear_suit()
else if(I == w_uniform)
if(r_store)
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store)
dropItemToGround(l_store, TRUE)
if(wear_id)
dropItemToGround(wear_id)
if(belt)
dropItemToGround(belt)
if(invdrop)
if(r_store)
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store)
dropItemToGround(l_store, TRUE)
if(wear_id)
dropItemToGround(wear_id)
if(belt)
dropItemToGround(belt)
w_uniform = null
update_suit_sensors()
update_inv_w_uniform()
update_inv_w_uniform(invdrop)
else if(I == gloves)
gloves = null
update_inv_gloves()
@@ -97,7 +97,7 @@ There are several things that need to be remembered:
/* --------------------------------------- */
//vvvvvv UPDATE_INV PROCS vvvvvv
/mob/living/carbon/human/update_inv_w_uniform()
/mob/living/carbon/human/update_inv_w_uniform(invdrop = TRUE)
remove_overlay(UNIFORM_LAYER)
if(client && hud_used)
@@ -136,7 +136,7 @@ There are several things that need to be remembered:
overlays_standing[UNIFORM_LAYER] = standing
else if(!(dna && dna.species.nojumpsuit))
else if(!(dna && dna.species.nojumpsuit) && invdrop)
// Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY
for(var/obj/item/thing in list(r_store, l_store, wear_id, belt)) //
dropItemToGround(thing)