Update MaybeFixed

Not sure if its due to the recent update FP put out but cant fly mega drones and it keeps giving this error:

Failed to call hook 'OnEntityMounted' on plugin 'MegaDrones v0.2.8' (ArgumentException: Object of type 'BasePlayer+EncryptedValue`1[System.UInt64]' cannot be converted to type 'System.UInt64'.)

at System.RuntimeType.CheckValue (System.Object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) [0x00071] in <467a840a914a47078e4ae9b0b1e8779e>:0

at System.Reflection.RuntimeFieldInfo.SetValue (System.Object obj, System.Object val, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) [0x0007d] in <467a840a914a47078e4ae9b0b1e8779e>:0

at System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) [0x00009] in <467a840a914a47078e4ae9b0b1e8779e>:0

at Oxide.Plugins.MegaDrones.StartControlling (BasePlayer player, ComputerStation station, IRemoteControllable controllable) [0x00027] in <78be3a63dc704e2ebddb7f877c66d8ee>:0

at Oxide.Plugins.MegaDrones.OnEntityMounted (ComputerStation station, BasePlayer player) [0x00012] in <78be3a63dc704e2ebddb7f877c66d8ee>:0

at Oxide.Plugins.MegaDrones.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00581] in <78be3a63dc704e2ebddb7f877c66d8ee>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <795304323ac74a298b8ed190a1dfa739>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in <beb2b64691c64e2b95b99491bd85442c>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <beb2b64691c64e2b95b99491bd85442c>:0

yeah getting the same error, player can mount but not fly the drone

Failed to call hook 'OnEntityMounted' on plugin 'MegaDrones v0.2.8' (ArgumentException: Object of type 'BasePlayer+EncryptedValue`1[System.UInt64]' cannot be converted to type 'System.UInt64'.)
  at System.RuntimeType.CheckValue (System.Object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) [0x00071] in :0 
  at System.Reflection.RuntimeFieldInfo.SetValue (System.Object obj, System.Object val, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) [0x0007d] in :0 
  at System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) [0x00009] in :0 
  at Oxide.Plugins.MegaDrones.StartControlling (BasePlayer player, ComputerStation station, IRemoteControllable controllable) [0x00027] in :0 
  at Oxide.Plugins.MegaDrones.OnEntityMounted (ComputerStation station, BasePlayer player) [0x00012] in :0 
  at Oxide.Plugins.MegaDrones.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00581] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in :0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in :0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0 
NKXTQs24ExGTuL8.jpg WhiteThunder

Thanks for the report. Can you test this version?
https://github.com/WheteThunger/MegaDrones

yes this version works, TY 

 

but i am getting this now from another plugin when you spawn the Megadrone 

 

Failed to call hook 'OnEntityBuilt' on plugin 'PlaceAnything v1.0.5' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.PlaceAnything.OnEntityBuilt (Planner plan, UnityEngine.GameObject go) [0x0002a] in :0 
  at Oxide.Plugins.PlaceAnything.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x000e6] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in :0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in :0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0 

Thanks for confirming, released it now on uMod.

As for the OnEntityBuilt issue, MegaDrones explicitly runs that hooks when the computer station is created. I don't recall the reason, something to do with integration with other plugins. Since it's not truly a player running the command, it's possible for plugins subscribing to that hook to make assumptions about the circumstances which aren't true in this case. For instance, no player is holding the planner item. Should be simple enough for PlaceAnything to catch this case and do nothing.

NKXTQs24ExGTuL8.jpg WhiteThunder

Thanks for confirming, released it now on uMod.

As for the OnEntityBuilt issue, MegaDrones explicitly runs that hooks when the computer station is created. I don't recall the reason, something to do with integration with other plugins. Since it's not truly a player running the command, it's possible for plugins subscribing to that hook to make assumptions about the circumstances which aren't true in this case. For instance, no player is holding the planner item. Should be simple enough for PlaceAnything to catch this case and do nothing.

Appreciate the quick update.

Yeah i just updated it myself to ignore the megadrone spawn, Thanks for your time 

Thank you guys, sorry for not responding I wrote this right before falling asleep.

Locked automatically