少年修仙传客户端代码仓库
client_Hale
2018-09-04 74a2c0f5affd6f8b0562196c541d854f1c310738
1827 NPC血量显示错误
1个文件已修改
28 ■■■■ 已修改文件
Fight/GameActor/GActorInfo.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorInfo.cs
@@ -138,7 +138,7 @@
    {
        get
        {
            return HpEx * FullHp + Hp;
            return (ulong)HpEx * FullHp + Hp;
        }
    }
@@ -146,7 +146,7 @@
    {
        get
        {
            return MaxHpEx * FullHp + MaxHp;
            return (ulong)MaxHpEx * FullHp + MaxHp;
        }
    }
@@ -185,10 +185,10 @@
    {
        ushort _multiple = (ushort)(value / FullHp);
        //if (sid != PlayerDatas.Instance.PlayerId)
        //{
        //    Debug.LogFormat("<color=red>伤血量: {0}, 当前hp: {1}, hpEx: {2}</color>", value, Hp, HpEx);
        //}
        // if (sid != PlayerDatas.Instance.PlayerId)
        // {
        //     Debug.LogFormat("<color=red>伤血量: {0}, 当前hp: {1}, hpEx: {2}</color>", value, Hp, HpEx);
        // }
        if (_multiple > HpEx)
        {
@@ -218,20 +218,20 @@
            Hp -= value;
        }
        //if (sid != PlayerDatas.Instance.PlayerId)
        //{
        //    if (HpEx != SyncServerHpEx)
        //    {
        //        Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx);
        //    }
        //}
        if (HpEx * FullHp + Hp < SyncServerHpEx * FullHp + SyncServerHp)
        {
            Hp = SyncServerHp;
            HpEx = SyncServerHpEx;
        }
        // if (sid != PlayerDatas.Instance.PlayerId)
        // {
        //     if (HpEx != SyncServerHpEx)
        //     {
        //         Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx);
        //     }
        // }
        if (OnHpChange != null)
        {
            OnHpChange(Hp);