fix frozen damage after rejoin

This commit is contained in:
GenZmeY 2022-10-23 03:02:54 +03:00
parent a2fba687d4
commit 8d432066ca
2 changed files with 15 additions and 10 deletions

View File

@ -73,7 +73,12 @@ function YAS_RepInfoPlayer FindRepInfo(KFPlayerReplicationInfo KFPRI)
{ {
if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid) if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid)
{ {
return RepInfo; if (RepInfo.bPendingDelete || RepInfo.bDeleteMe)
{
RepInfos.RemoveItem(RepInfo);
break;
}
else return RepInfo;
} }
} }
@ -81,6 +86,8 @@ function YAS_RepInfoPlayer FindRepInfo(KFPlayerReplicationInfo KFPRI)
{ {
if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid) if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid)
{ {
if (RepInfo.bPendingDelete || RepInfo.bDeleteMe) continue;
RepInfos.AddItem(RepInfo); RepInfos.AddItem(RepInfo);
return RepInfo; return RepInfo;
} }
@ -615,7 +622,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
ShapeHealth = Settings.Style.ShapeStateHealthBoxMidPlayer; ShapeHealth = Settings.Style.ShapeStateHealthBoxMidPlayer;
if (!KFGRI.bMatchHasBegun) if (!(KFGRI.bMatchHasBegun || KFGRI.bTraderIsOpen || KFGRI.bWaveIsActive))
{ {
HealthBoxColor = Settings.Style.StateBoxColorLobby; HealthBoxColor = Settings.Style.StateBoxColorLobby;
} }
@ -638,7 +645,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
EdgeSize, EdgeSize,
ShapeHealth); ShapeHealth);
if (!KFGRI.bMatchHasBegun) if (!(KFGRI.bMatchHasBegun || KFGRI.bTraderIsOpen || KFGRI.bWaveIsActive))
{ {
ColorTMP = Settings.Style.ListHeaderTextColor; ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 200; ColorTMP.A = 200;
@ -662,11 +669,9 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
HealthWBox - BorderSize * 4, HealthWBox - BorderSize * 4,
Height - BorderSize * 4); Height - BorderSize * 4);
} }
else
C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh);
if (KFPRI.PlayerHealth > 0)
{ {
C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh);
DrawTextShadowHVCenter(String(KFPRI.PlayerHealth), HealthXPos, YOffset, HealthWBox, Height, FontScalar); DrawTextShadowHVCenter(String(KFPRI.PlayerHealth), HealthXPos, YOffset, HealthWBox, Height, FontScalar);
} }