The "Item" class which represents items such as those in the player's inventory has this enum defined in it:
[Flags]
public enum Flag
{
None = 0,
Placeholder = 1,
IsOn = 2,
OnFire = 4,
IsLocked = 8,
Cooking = 16
}It's used for this field in the class:
public Item.Flag flags;When I try to use the constant Item.Flag.IsOn in a plugin, I get the following error:
Error while compiling SimpleRepro: 'Item' does not contain a definition for 'Flag' and no accessible extension method 'Flag' accepting a first argument of type 'Item' could be found (are you missing a using directive or an assembly reference?) | Line: 9, Pos: 23
Here's the plugin to repro the error:
namespace Oxide.Plugins
{
[Info("SimpleRepro", "nex", "0.0.0")]
class SimpleRepro : RustPlugin
{
void Init() {
Puts("Init");
Item.Flag f = Item.Flag.IsOn;
}
}
}
Note: There are no "using" statements in this repro.
I even used reflection to see that there is something called "Flag" under "Item", but the compiler error is unexpected. Is it something obvious I'm missing?
Thanks!