diff --git a/language.version b/language.version index 0f34f0a81..878f5ab56 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r566 \cu(Wed 30 Jun 19:55:45 CEST 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r566 \cu(2021-06-30 19:55:45)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r567 \cu(Thu 1 Jul 10:09:16 CEST 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r567 \cu(2021-07-01 10:09:16)\c-"; diff --git a/zscript/handler/swwm_handler_vanillaboss.zsc b/zscript/handler/swwm_handler_vanillaboss.zsc index 8a0fe00db..2defae930 100644 --- a/zscript/handler/swwm_handler_vanillaboss.zsc +++ b/zscript/handler/swwm_handler_vanillaboss.zsc @@ -392,10 +392,13 @@ extend Class SWWMHandler if ( !bbar_d ) bbar_d = TexMan.CheckForTexture("graphics/HUD/BossHealthBarDecay.png",TexMan.Type_Any); Vector2 vpos = ((bar.ss.x-300)/2.,bar.ss.y-(bar.margin+35)); Screen.DrawTexture(bbar_f,false,vpos.x-2,vpos.y-2,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha); - int rw = int(clamp((ihealthr.GetValue()*300.)/hmax,0.,300.)); - int dw = int(clamp((ihealth.GetValue()*300.)/hmax,0.,300.)); - Screen.DrawTexture(bbar_d,false,vpos.x,vpos.y,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha,DTA_WindowRight,dw); - Screen.DrawTexture(bbar_r,false,vpos.x,vpos.y,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha,DTA_WindowRight,rw); + if ( hmax ) + { + int rw = int(clamp((ihealthr.GetValue()*300.)/hmax,0.,300.)); + int dw = int(clamp((ihealth.GetValue()*300.)/hmax,0.,300.)); + Screen.DrawTexture(bbar_d,false,vpos.x,vpos.y,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha,DTA_WindowRight,dw); + Screen.DrawTexture(bbar_r,false,vpos.x,vpos.y,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha,DTA_WindowRight,rw); + } Font barfnt = bar.LangFont(bar.mTewiFont); Font dmgfnt = bar.mTewiFont.mFont; if ( (cummdamage > 0) && (gametic < lastcummtic+150) )