Merge pull request #8753 from Spookerton/spkrtn/fix/assorted-221015

fixes for a number of logged errors
This commit is contained in:
Atermonera
2022-10-16 09:57:57 -08:00
committed by GitHub
9 changed files with 204 additions and 185 deletions

View File

@@ -730,6 +730,24 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
pref.h_style = new_h_style
return TOPIC_REFRESH_UPDATE_PREVIEW
else if (href_list["hair_style_left"])
var/list/valid_hairstyles = pref.get_valid_hairstyles()
var/index = valid_hairstyles.Find(href_list["hair_style_left"])
if (!index || index == 1)
pref.h_style = valid_hairstyles[length(valid_hairstyles)]
else
pref.h_style = valid_hairstyles[index - 1]
return TOPIC_REFRESH_UPDATE_PREVIEW
else if (href_list["hair_style_right"])
var/list/valid_hairstyles = pref.get_valid_hairstyles()
var/index = valid_hairstyles.Find(href_list["hair_style_right"])
if (!index || index == length(valid_hairstyles))
pref.h_style = valid_hairstyles[1]
else
pref.h_style = valid_hairstyles[index + 1]
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["grad_style"])
var/list/valid_gradients = GLOB.hair_gradients
@@ -738,26 +756,22 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
pref.grad_style = new_grad_style
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["hair_style_left"])
var/H = href_list["hair_style_left"]
var/list/valid_hairstyles = pref.get_valid_hairstyles()
var/start = valid_hairstyles.Find(H)
if(start != 1) //If we're not the beginning of the list, become the previous element.
pref.h_style = valid_hairstyles[start-1]
else //But if we ARE, become the final element.
pref.h_style = valid_hairstyles[valid_hairstyles.len]
else if (href_list["grad_style_left"])
var/list/valid_hair_gradients = GLOB.hair_gradients
var/index = valid_hair_gradients.Find(href_list["grad_style_left"])
if (!index || index == 1)
pref.grad_style = valid_hair_gradients[length(valid_hair_gradients)]
else
pref.grad_style = valid_hair_gradients[index - 1]
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["hair_style_right"])
var/H = href_list["hair_style_right"]
var/list/valid_hairstyles = pref.get_valid_hairstyles()
var/start = valid_hairstyles.Find(H)
if(start != valid_hairstyles.len) //If we're not the end of the list, become the next element.
pref.h_style = valid_hairstyles[start+1]
else //But if we ARE, become the first element.
pref.h_style = valid_hairstyles[1]
else if (href_list["grad_style_right"])
var/list/valid_hair_gradients = GLOB.hair_gradients
var/index = valid_hair_gradients.Find(href_list["grad_style_right"])
if (!index || index == length(valid_hair_gradients))
pref.grad_style = valid_hair_gradients[1]
else
pref.grad_style = valid_hair_gradients[index + 1]
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["facial_color"])
@@ -806,26 +820,22 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
pref.f_style = new_f_style
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["facial_style_left"])
var/F = href_list["facial_style_left"]
else if (href_list["facial_style_left"])
var/list/valid_facialhairstyles = pref.get_valid_facialhairstyles()
var/start = valid_facialhairstyles.Find(F)
if(start != 1) //If we're not the beginning of the list, become the previous element.
pref.f_style = valid_facialhairstyles[start-1]
else //But if we ARE, become the final element.
pref.f_style = valid_facialhairstyles[valid_facialhairstyles.len]
var/index = valid_facialhairstyles.Find(href_list["facial_style_left"])
if (!index || index == 1)
pref.f_style = valid_facialhairstyles[length(valid_facialhairstyles)]
else
pref.f_style = valid_facialhairstyles[index - 1]
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["facial_style_right"])
var/F = href_list["facial_style_right"]
else if (href_list["facial_style_right"])
var/list/valid_facialhairstyles = pref.get_valid_facialhairstyles()
var/start = valid_facialhairstyles.Find(F)
if(start != valid_facialhairstyles.len) //If we're not the end of the list, become the next element.
pref.f_style = valid_facialhairstyles[start+1]
else //But if we ARE, become the first element.
var/index = valid_facialhairstyles.Find(href_list["facial_style_right"])
if (!index || index == length(valid_facialhairstyles))
pref.f_style = valid_facialhairstyles[1]
else
pref.f_style = valid_facialhairstyles[index + 1]
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["marking_style"])

View File

@@ -91,27 +91,16 @@
return
/obj/item/reagent_containers/pill/attackby(obj/item/W as obj, mob/user as mob)
if(is_sharp(W))
var/obj/item/reagent_containers/powder/J = new /obj/item/reagent_containers/powder(src.loc)
user.visible_message("<span class='warning'>[user] gently cuts up [src] with [W]!</span>")
playsound(src.loc, 'sound/effects/chop.ogg', 50, 1)
if(reagents)
reagents.trans_to_obj(J, reagents.total_volume)
J.get_appearance()
/obj/item/reagent_containers/pill/attackby(obj/item/item, mob/living/user)
if (is_sharp(item) || istype(item, /obj/item/card))
user.visible_message(
SPAN_ITALIC("\The [user] cuts up \a [src] with \a [item]."),
SPAN_ITALIC("You cut up \the [src] with \the [item].")
)
playsound(loc, 'sound/effects/chop.ogg', 50, 1)
new /obj/item/reagent_containers/powder (loc, reagents)
qdel(src)
if(istype(W, /obj/item/card/id))
var/obj/item/reagent_containers/powder/J = new /obj/item/reagent_containers/powder(src.loc)
user.visible_message("<span class='warning'>[user] clumsily chops up [src] with [W]!</span>")
playsound(src.loc, 'sound/effects/chop.ogg', 50, 1)
if(reagents)
reagents.trans_to_obj(J, reagents.total_volume)
J.get_appearance()
qdel(src)
return TRUE
return ..()
////////////////////////////////////////////////////////////////////////////////