ServUO Version
Publish 57
Ultima Expansion
Endless Journey
What is the difference between 'long' and 'int' ? I get this error on my PlayerMobile.cs
CS0266: Line 90: Cannot implicitly convert type 'uint' to 'int'. An explicit conversion exists (are you missing a cast?)
CS0266: Line 91: Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)
CS0266: Line 92: Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)
CS0266: Line 94: Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)
CS0266: Line 97: Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)
CS0266: Line 99: Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)
Is it because I added an extra 0?
#region Enums
[Flags]
public enum PlayerFlag
{
None = 0x00000000,
Glassblowing = 0x00000001,
Masonry = 0x00000002,
SandMining = 0x00000004,
StoneMining = 0x00000008,
ToggleMiningStone = 0x00000010,
KarmaLocked = 0x00000020,
AutoRenewInsurance = 0x00000040,
UseOwnFilter = 0x00000080,
PublicMyRunUO = 0x00000100,
PagingSquelched = 0x00000200,
Young = 0x00000400,
AcceptGuildInvites = 0x00000800,
DisplayChampionTitle = 0x00001000,
HasStatReward = 0x00002000,
Bedlam = 0x00010000,
LibraryFriend = 0x00020000,
Spellweaving = 0x00040000,
GemMining = 0x00080000,
ToggleMiningGem = 0x00100000,
BasketWeaving = 0x00200000,
AbyssEntry = 0x00400000,
ToggleClippings = 0x00800000,
ToggleCutClippings = 0x01000000,
ToggleCutReeds = 0x02000000,
MechanicalLife = 0x04000000,
Unused = 0x08000000,
ToggleCutTopiaries = 0x10000000,
HasValiantStatReward = 0x20000000,
RefuseTrades = 0x40000000,
line 90 DisabledPvpWarning = 0x80000000,
line 91 CanBuyCarpets = 0x100000000,
line 92 VoidPool = 0x200000000,
// Jeweled Bow Craft
line 94 JeweledBowCrafting = 0x0200000000,
// Jeweled Bow Craft
// Magic Clothes Sewing
line 97 Sewing = 0x0400000000,
// Magic Clothes Sewing
line 99 FireRockMining = 0x0600000000,
}
 
What is the difference between 'long' and 'int' ?
A long is a 64-bit integer where an int is a 32-bit integer. It should be safe to cast a long to an int if you never plan on the number exceeding 2,147,483,647 or -2,147,483,647. A uint or ulong are unsigned integers meaning they cannot go below 0. If they do, they will roll over so -1 would be 2,147,483,646.
 
Back