XavierCHN / x-template

DOTA2自定义游戏开发模板项目,使用typesscript和react开发; Xavier's DOTA 2 custom game template using typescript and react-panorama
MIT License
154 stars 88 forks source link

会导致游戏闪退的情况集合 #25

Closed XavierCHN closed 1 year ago

XavierCHN commented 2 years ago

这个帖子用来收集dota2自定义游戏开发过程中,会导致游戏直接闪退的情况

XavierCHN commented 2 years ago

SetCustomHeroMaxLevelSetCustomXPRequiredToReachNextLevel 的数量不一致,会直接导致闪退

XavierCHN commented 2 years ago

panorama ui引用了不存在的文件

XavierCHN commented 2 years ago

custom net table的单个table超过16kb大小或者所有net table的数据超过2mb(具体的确切数值还需要进一步确认)

CabinIkaros commented 1 year ago

熠熠生辉炸方修复

@registerAbility()
export class dawnbreaker_luminosity extends BaseAbility
{
    GetIntrinsicModifierName(): string
    {
        return modifier_dawnbreaker_luminosity_patch.name;
    }
}

@registerModifier()
export class modifier_dawnbreaker_luminosity_patch extends BaseModifier
{
    IsHidden(): boolean
    {
        return false;
    }

    OnRefresh(params: object)
    {
        if (!IsServer() || this.GetAbility().GetLevel() == 0)
            return;

        if (this.GetParent().HasModifier("modifier_dawnbreaker_luminosity"))
        {
            return;
        }

        this.GetParent().AddNewModifier(this.GetParent(), this.GetAbility(), "modifier_dawnbreaker_luminosity",{});
    }

    OnDestroy()
    {
        if (!IsServer() || this.GetAbility().GetLevel() == 0)
            return;

        this.GetParent().RemoveModifierByName("modifier_dawnbreaker_luminosity");
    }
}