Fixes projectiles embedding in mobs that they pass through

This commit is contained in:
mwerezak
2015-02-17 01:32:14 -05:00
parent 8c3660357a
commit b1546ee3eb
3 changed files with 22 additions and 10 deletions

View File

@@ -13,16 +13,17 @@
var/mob/living/L = target
shake_camera(L, 3, 2)
/obj/item/projectile/bullet/on_penetrate(var/atom/A)
if(!A || !A.density) return 1 //if whatever it was got destroyed when we hit it, then I guess we can just keep going
/obj/item/projectile/bullet/check_penetrate(var/atom/A)
if(!A || !A.density) return 1 //if whatever it was got destroyed when we hit it, then I guess we can just keep going
if(istype(A, /obj/mecha))
return 1 //mecha have their own penetration handling
if(ismob(A))
if(iscarbon(A))
if (damage <= 20 && !prob(damage)) return 0
damage *= 0.7 //squishy mobs absorb KE
//squishy mobs absorb KE
if(can_embed()) return 0
damage *= 0.7
return 1
var/chance = 0