-
Member
Error CS0266 - ActorSnoEnum assistance
Wasn't able to find the original plugin thread
Below is the exception that I'm getting:
Plugins\WindyForce\PlayerCirclesPlugin.cs(138,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(139,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(143,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(144,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(148,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(149,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(153,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
Plugins\WindyForce\PlayerCirclesPlugin.cs(154,6) : error CS0266: Cannot implicitly convert type 'int' to 'Turbo.Plugins.ActorSnoEnum'. An explicit conversion exists (are you missing a cast?)
cont. (158,6)
(159,6)
(163,6)
(164,6)
(168,6)
(169,6)
Since I can't find the original thread, here is a pastebin - windy circles - Pastebin.com
public void PaintWorld(WorldLayer layer)
{
var actors = Hud.Game.Actors;
foreach (var actor in actors)
{
switch (actor.SnoActor.Sno)
{
case 6526:
case 6544:
WizardDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
break;
Where can I find the ActorSnoEnum. ?? I know on another plugin the case # changed to a ActorSnoEnum.------
-
Legendary
Option 1
The quick version is to make a cast, and convert the data type of actor.SnoActor.Sno of ActorSnoEnum to uint ( writing "(uint)" ahead ) , according to this you should change the line 136
Code:
switch (actor.SnoActor.Sno)
to
Code:
switch ((uint)actor.SnoActor.Sno)
Option 2
The most correct way is to do what you ask (although if you need to change too many numbers it is more convenient to resort to the above), for this you must look
at interfaces\sno\enums\Actor.cs
For example. for the 6526 corresponds _wizard_female , and you put ActorSnoEnum. in front, according to this you should change the line 138
to
Code:
case ActorSnoEnum._wizard_female:
Last edited by RNN; 03-28-2019 at 08:54 PM.
-
Post Thanks / Like - 1 Thanks
DankLordddd (1 members gave Thanks to RNN for this useful post)
-
Member
Thank you RNN! I went through the exercise of option 2 and updated the cases.