Skip to content

Detect NPC/Projectile/Item.CloneDefaults usage after assigning fields #18

@direwolf420

Description

@direwolf420

A common mistake some modders make is writing code like this:

Item.damage = 20;
Item.scale = 2;
Item.CloneDefaults(ItemID.Muramasa);
Item.knockBack = 3f;

Which will not cause an error, but it will ignore the assignments prior to CloneDefaults.
A warning or an error thrown by the analyzer would be helpful in highlighting potential issues.

This should be done for all instances of CloneDefaults for vanilla content classes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions