Skip to content

Commit

Permalink
fix bad cut_overlay call (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapu1178 authored Nov 21, 2023
1 parent 99dab3b commit 494f1ff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var/fulltile = FALSE
var/glass_type = /obj/item/stack/sheet/glass
var/glass_amount = 1
var/mutable_appearance/crack_overlay

var/real_explosion_block //ignore this, just use explosion_block
var/break_sound = SFX_SHATTER
var/knock_sound = 'sound/effects/glassknock.ogg'
Expand Down Expand Up @@ -406,16 +406,15 @@
if(QDELETED(src) || !fulltile)
return

if((updates & UPDATE_SMOOTHING))
if((updates & UPDATE_SMOOTHING) && (smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK)))
QUEUE_SMOOTH(src)

var/ratio = atom_integrity / max_integrity
ratio = CEILING(ratio*4, 1) * 25
cut_overlay(crack_overlay)
if(ratio > 75)
return
crack_overlay = mutable_appearance('icons/obj/structures.dmi', "damage[ratio]", -(layer+0.1), appearance_flags = RESET_COLOR)
. += crack_overlay

. += mutable_appearance('icons/obj/structures.dmi', "damage[ratio]", -(layer+0.1), appearance_flags = RESET_COLOR)

/obj/structure/window/fire_act(exposed_temperature, exposed_volume)
if (exposed_temperature > melting_point)
Expand Down

0 comments on commit 494f1ff

Please sign in to comment.