Merge pull request #115 from Seris02/bottlesmash

fixes bottle smashing
This commit is contained in:
quotefox
2019-12-12 01:08:21 +00:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
@@ -14,6 +14,7 @@
volume = 50
resistance_flags = NONE
var/isGlass = TRUE //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
splashable = TRUE
/obj/item/reagent_containers/food/drinks/on_reagent_change(changetype)
if (gulp_size < 5)
@@ -104,6 +105,7 @@
/obj/item/reagent_containers/food/drinks/throw_impact(atom/target, datum/thrownthing/throwinfo)
. = ..()
if(!.) //if the bottle wasn't caught
SplashReagents(target)
smash(target, throwinfo.thrower, TRUE)
/obj/item/reagent_containers/food/drinks/proc/smash(atom/target, mob/thrower, ranged = FALSE)
+2 -1
View File
@@ -17,6 +17,7 @@
var/spillable = FALSE
var/beaker_weakness_bitflag = NONE//Bitflag!
var/container_HP = 2
var/splashable = FALSE
/obj/item/reagent_containers/Initialize(mapload, vol)
. = ..()
@@ -92,7 +93,7 @@
transform = initial(transform)
/obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE)
if(!reagents || !reagents.total_volume || !spillable)
if(!reagents || !reagents.total_volume || !(splashable ? splashable : spillable))
return
if(ismob(target) && target.reagents)