fixces 2 mech runtimes (#8095)

This commit is contained in:
Kashargul
2024-03-28 22:59:18 +01:00
committed by GitHub
parent 356f117990
commit 852edfbd7e
2 changed files with 4 additions and 2 deletions

View File

@@ -234,7 +234,7 @@
return ..()
/obj/item/mecha_parts/mecha_equipment/proc/detach(atom/moveto=null)
if(!chassis)
if(!chassis || !get_turf(chassis)) //CHOMPEdit don't detach components in nullspace
return
moveto = moveto || get_turf(chassis)
forceMove(moveto)

View File

@@ -1243,9 +1243,11 @@
pass_damage_reduc_mod = 1
pass_damage = (pass_damage_reduc_mod*pass_damage)//Apply damage reduction before usage.
src.take_damage(pass_damage, Proj.check_armour) //The take_damage() proc handles armor values
//CHOMPEdit Start we can spark even when taking no damage. But don't check after a proc that might have deleted this
if(prob(25))
spark_system.start()
src.take_damage(pass_damage, Proj.check_armour) //The take_damage() proc handles armor values
//CHOMPEdit End
if(pass_damage > internal_damage_minimum) //Only decently painful attacks trigger a chance of mech damage.
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),ignore_threshold)