Merge pull request #6714 from Citadel-Station-13/upstream-merge-37760
[MIRROR] Fixed stacks sometimes having the wrong amount if created on another stack
This commit is contained in:
@@ -104,8 +104,7 @@
|
||||
to_chat(user, "<span class='warning'>There is another network terminal here!</span>")
|
||||
return
|
||||
else
|
||||
var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(T)
|
||||
C.amount = 10
|
||||
new /obj/item/stack/cable_coil(T, 10)
|
||||
to_chat(user, "<span class='notice'>You cut the cables and disassemble the unused power terminal.</span>")
|
||||
qdel(E)
|
||||
return TRUE
|
||||
|
||||
@@ -211,10 +211,9 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \
|
||||
if(W.is_sharp())
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
|
||||
user.visible_message("[user] starts cutting hair off \the [src].", "<span class='notice'>You start cutting the hair off \the [src]...</span>", "<span class='italics'>You hear the sound of a knife rubbing against flesh.</span>")
|
||||
if(do_after(user,50, target = src))
|
||||
if(do_after(user, 50, target = src))
|
||||
to_chat(user, "<span class='notice'>You cut the hair from this [src.singular_name].</span>")
|
||||
var/obj/item/stack/sheet/hairlesshide/HS = new(user.loc)
|
||||
HS.amount = 1
|
||||
new /obj/item/stack/sheet/hairlesshide(user.drop_location(), 1)
|
||||
use(1)
|
||||
else
|
||||
return ..()
|
||||
@@ -228,21 +227,11 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \
|
||||
if(exposed_temperature >= drying_threshold_temperature)
|
||||
wetness--
|
||||
if(wetness == 0)
|
||||
//Try locating an exisitng stack on the tile and add to there if possible
|
||||
for(var/obj/item/stack/sheet/leather/HS in src.loc)
|
||||
if(HS.amount < 50)
|
||||
HS.amount++
|
||||
src.use(1)
|
||||
wetness = initial(wetness)
|
||||
break
|
||||
//If it gets to here it means it did not find a suitable stack on the tile.
|
||||
var/obj/item/stack/sheet/leather/HS = new(src.loc)
|
||||
HS.amount = 1
|
||||
new /obj/item/stack/sheet/leather(drop_location(), 1)
|
||||
wetness = initial(wetness)
|
||||
src.use(1)
|
||||
use(1)
|
||||
|
||||
/obj/item/stack/sheet/wetleather/microwave_act(obj/machinery/microwave/MW)
|
||||
..()
|
||||
var/obj/item/stack/sheet/leather/L = new(loc)
|
||||
L.amount = amount
|
||||
new /obj/item/stack/sheet/leather(drop_location(), amount)
|
||||
qdel(src)
|
||||
|
||||
@@ -14,13 +14,12 @@
|
||||
grind_results = list("silicon" = 20, "copper" = 5)
|
||||
|
||||
/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params)
|
||||
|
||||
var/atom/Tsec = user.drop_location()
|
||||
if(istype(O, /obj/item/wirecutters))
|
||||
var/obj/item/stack/cable_coil/CC = new (user.loc)
|
||||
CC.amount = 5
|
||||
var/obj/item/stack/cable_coil/CC = new (Tsec, 5)
|
||||
CC.add_fingerprint(user)
|
||||
amount--
|
||||
var/obj/item/stack/sheet/glass/G = new (user.loc)
|
||||
var/obj/item/stack/sheet/glass/G = new (Tsec)
|
||||
G.add_fingerprint(user)
|
||||
if(amount <= 0)
|
||||
qdel(src)
|
||||
@@ -28,7 +27,6 @@
|
||||
else if(istype(O, /obj/item/stack/sheet/metal))
|
||||
var/obj/item/stack/sheet/metal/M = O
|
||||
if (M.use(1))
|
||||
use(1)
|
||||
var/obj/item/L = new /obj/item/stack/tile/light(user.loc)
|
||||
to_chat(user, "<span class='notice'>You make a light tile.</span>")
|
||||
L.add_fingerprint(user)
|
||||
|
||||
@@ -121,6 +121,9 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
||||
/obj/item/stack/sheet/metal/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/sheet/metal/ten
|
||||
amount = 10
|
||||
|
||||
/obj/item/stack/sheet/metal/five
|
||||
amount = 5
|
||||
|
||||
|
||||
@@ -33,10 +33,13 @@
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/Initialize(mapload, new_amount=null , merge = TRUE)
|
||||
/obj/item/stack/Initialize(mapload, new_amount, merge = TRUE)
|
||||
. = ..()
|
||||
if(new_amount)
|
||||
if(new_amount != null)
|
||||
amount = new_amount
|
||||
while(amount > max_amount)
|
||||
amount -= max_amount
|
||||
new type(loc, max_amount, FALSE)
|
||||
if(!merge_type)
|
||||
merge_type = type
|
||||
if(merge)
|
||||
|
||||
Reference in New Issue
Block a user