[MIRROR] Fixes stacks and material containers, fixes wet floors (#6008)

* Fixes stacks and material containers, fixes wet floors (#36497)

* Fixes stacks and material containers, fixes wet floors
This commit is contained in:
CitadelStationBot
2018-03-19 21:06:33 -05:00
committed by Poojawa
parent c17da68be6
commit 1fd5de5bfe
5 changed files with 77 additions and 58 deletions
@@ -39,7 +39,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"as" = (
@@ -50,7 +50,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"at" = (
@@ -59,7 +59,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"au" = (
@@ -89,7 +89,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"ay" = (
@@ -99,7 +99,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"az" = (
@@ -110,7 +110,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aA" = (
@@ -120,7 +120,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aB" = (
@@ -129,20 +129,20 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aC" = (
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aD" = (
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aE" = (
@@ -151,7 +151,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aF" = (
@@ -162,7 +162,7 @@
/obj/effect/decal/cleanable/cobweb,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aG" = (
@@ -171,7 +171,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aH" = (
@@ -181,7 +181,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aI" = (
@@ -191,7 +191,7 @@
/obj/item/bikehorn,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aJ" = (
@@ -208,7 +208,7 @@
/obj/effect/decal/cleanable/pie_smudge,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aL" = (
@@ -224,7 +224,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aO" = (
@@ -235,7 +235,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aP" = (
@@ -258,7 +258,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aU" = (
@@ -272,7 +272,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aW" = (
@@ -283,7 +283,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aX" = (
@@ -302,7 +302,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"aZ" = (
@@ -318,7 +318,7 @@
/obj/effect/decal/cleanable/pie_smudge,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bb" = (
@@ -337,7 +337,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bd" = (
@@ -370,7 +370,7 @@
/obj/effect/decal/cleanable/pie_smudge,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bg" = (
@@ -476,21 +476,21 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bx" = (
/obj/effect/decal/cleanable/cobweb,
/turf/open/indestructible{
icon_state = "darkredfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"by" = (
/obj/structure/disposalpipe/segment,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bz" = (
@@ -505,7 +505,7 @@
"bA" = (
/turf/open/indestructible{
icon_state = "darkredfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bB" = (
@@ -513,7 +513,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bC" = (
@@ -524,7 +524,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bD" = (
@@ -550,7 +550,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bH" = (
@@ -559,7 +559,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bI" = (
@@ -567,7 +567,7 @@
/obj/effect/decal/cleanable/blood/old,
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bJ" = (
@@ -577,7 +577,7 @@
},
/turf/open/indestructible{
icon_state = "darkredfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bK" = (
@@ -586,7 +586,7 @@
},
/turf/open/indestructible{
icon_state = "darkredfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bL" = (
@@ -610,7 +610,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bP" = (
@@ -657,7 +657,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bY" = (
@@ -667,7 +667,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"bZ" = (
@@ -676,7 +676,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"ca" = (
@@ -686,7 +686,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"cc" = (
@@ -710,7 +710,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"dC" = (
@@ -723,7 +723,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"dD" = (
@@ -735,7 +735,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"dE" = (
@@ -748,7 +748,7 @@
},
/turf/open/indestructible{
icon_state = "darkyellowfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"dF" = (
@@ -793,7 +793,7 @@
},
/turf/open/indestructible{
icon_state = "darkredfull";
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"dK" = (
@@ -820,7 +820,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"dO" = (
@@ -829,7 +829,7 @@
icon_state = "bananium";
name = "bananium floor";
sound = 'sound/effects/clownstep1.ogg';
wet = 5
wet = 8
},
/area/ruin/powered/clownplanet)
"eX" = (
+2 -2
View File
@@ -188,9 +188,9 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
//Wet floor type flags. Stronger ones should be higher in number.
#define TURF_DRY 0
#define TURF_WET_WATER 1
#define TURF_WET_LUBE 2
#define TURF_WET_PERMAFROST 2
#define TURF_WET_ICE 4
#define TURF_WET_PERMAFROST 8
#define TURF_WET_LUBE 8
#define IS_WET_OPEN_TURF(O) O.GetComponent(/datum/component/wet_floor)
+3 -1
View File
@@ -89,7 +89,9 @@
var/obj/item/stack/S = I
to_chat(user, "<span class='notice'>You insert [inserted] [S.singular_name][inserted>1 ? "s" : ""] into [parent].</span>")
if(!QDELETED(I))
user.put_in_active_hand(I)
if(!user.put_in_hands(I))
stack_trace("Warning: User could not put object back in hand during material container insertion, line [__LINE__]! This can lead to issues.")
I.forceMove(user.drop_location())
else
to_chat(user, "<span class='notice'>You insert a material total of [inserted] into [parent].</span>")
qdel(I)
+23 -6
View File
@@ -21,17 +21,17 @@
for(var/i in WF.time_left_list)
add_wet(text2num(i), WF.time_left_list[i])
/datum/component/wet_floor/Initialize(strength, duration_minimum, duration_add, duration_maximum, permanent = FALSE)
/datum/component/wet_floor/Initialize(strength, duration_minimum, duration_add, duration_maximum, _permanent = FALSE)
if(!isopenturf(parent))
. = COMPONENT_INCOMPATIBLE
CRASH("Wet floor component attempted to be applied to a non open turf!")
add_wet(strength, duration_minimum, duration_add, duration_maximum)
RegisterSignal(COMSIG_TURF_IS_WET, .proc/is_wet)
RegisterSignal(COMSIG_TURF_MAKE_DRY, .proc/dry)
permanent = _permanent
if(!permanent)
START_PROCESSING(SSwet_floors, src)
if(gc())
stack_trace("Warning: Wet floor component added and immediately deleted! What a waste of time!")
addtimer(CALLBACK(src, .proc/gc, TRUE), 1) //GC after initialization.
/datum/component/wet_floor/Destroy()
STOP_PROCESSING(SSwet_floors, src)
@@ -140,10 +140,23 @@
var/turf/T = to_datum
T.add_overlay(current_overlay)
/datum/component/wet_floor/proc/add_wet(type, duration_minimum = 0, duration_add = 0, duration_maximum = MAXIMUM_WET_TIME)
/datum/component/wet_floor/proc/add_wet(type, duration_minimum = 0, duration_add = 0, duration_maximum = MAXIMUM_WET_TIME, _permanent = FALSE)
var/static/list/allowed_types = list(TURF_WET_WATER, TURF_WET_LUBE, TURF_WET_ICE, TURF_WET_PERMAFROST)
if(!duration_minimum || duration_minimum < 0 || !type || !(type in allowed_types))
if(duration_minimum <= 0 || !type)
return FALSE
if(type in allowed_types)
return _do_add_wet(type, duration_minimum, duration_add, duration_maximum)
else
. = NONE
for(var/i in allowed_types)
if(!(type & i))
continue
. |= _do_add_wet(i, duration_minimum, duration_add, duration_maximum)
if(_permanent)
permanent = TRUE
STOP_PROCESSING(SSwet_floors, src)
/datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum)
var/time = 0
if(LAZYACCESS(time_left_list, "[type]"))
time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
@@ -153,10 +166,14 @@
check(TRUE)
return TRUE
/datum/component/wet_floor/proc/gc()
/datum/component/wet_floor/proc/gc(on_init = FALSE)
if(!LAZYLEN(time_left_list))
if(on_init)
var/turf/T = parent
stack_trace("Warning: Wet floor component gc'd right initializatoin! What a waste of time and CPU! Type = [T? T.type : "ERROR - NO PARENT"], Coords = [istype(T)? COORD(T) : "ERROR - INVALID PARENT"].")
qdel(src)
return TRUE
return FALSE
/datum/component/wet_floor/proc/check(force_update = FALSE)
var/changed = FALSE
+1 -1
View File
@@ -7,7 +7,7 @@
var/list/archdrops
var/wet
/turf/open/Initialize()
/turf/open/ComponentInitialize()
. = ..()
if(wet)
AddComponent(/datum/component/wet_floor, wet, INFINITY, 0, INFINITY, TRUE)