No overload for method `OnDeployed' takes `2' argumentsSolved

Error while compiling: CustomPopulations.cs(1016,28): error CS1501: No overload for method `OnDeployed' takes `2' arguments

I'd suggest reporting the error to the author of the plugin.

Go0ePa8S2poB3OZ.jpg Wulf

I'd suggest reporting the error to the author of the plugin.

plugin author in the army


Merged post

Before the updates everything worked fine, I think this is the method.

Merged post

ЯI can try to fix the plugin myself if you can explain to me what has changed in this method? "OnDeployed"

Merged post

foreach (var slot in _checkSlots)
{
var slotName = slot.ToString().ToLower();

var info = structure.GetType().GetField(slotName + "Item");
if (info == null) continue;

if (!ent.HasSlot(slot) || info.GetValue(structure) == null) continue;

var slotData = info.GetValue(structure) as Dictionary<string, object>;
var slotEntity = GameManager.server.CreateEntity((string)slotData["prefabname"], Vector3.zero);

if (slotEntity == null) continue;
slotEntity.gameObject.Identity();
slotEntity.SetParent(ent, slotName);
slotEntity.OnDeployed(ent, null);
slotEntity.Spawn();

ent.SetSlot(slot, slotEntity);
entitySlots.Add(slotEntity);

if (slotName != "lock" || !slotData.ContainsKey("code")) continue;

if (slotEntity.GetComponent<CodeLock>())
{
var code = (string)slotData["code"];
if (!string.IsNullOrEmpty(code))
{
var codeLock = slotEntity.GetComponent<CodeLock>();
codeLock.code = code;
codeLock.hasCode = true;
codeLock.SetFlag(BaseEntity.Flags.Locked, true);
}
}
else if (slotEntity.GetComponent<KeyLock>())
{
var code = Convert.ToInt32(slotData["code"]);
var keyLock = slotEntity.GetComponent<KeyLock>();

if ((code & 0x80) != 0)
{
keyLock.keyCode = (code & 0x7F);
keyLock.firstKeyCreated = true;
keyLock.SetFlag(BaseEntity.Flags.Locked, true);
}
}
}
return entitySlots;

Merged post

added:
private readonly Item _emptyItem = new Item { info = new ItemDefinition() };
changed:

slotEntity.OnDeployed(ent, null, _emptyItem);

Locked automatically