With current code players able to dupe whole pets inventory on each plugin reload/server restart. They just should kill the pet, the inventory content will be droped, but after restart the pet will be spawned with restored inventory again. To prevent this, find the code block:
internal void OnDeath()
{
if (owner != null)
{
owner.enabled = false;
owner.npcAi = null;
UserMessage(owner.player, "ondeath");
Destroy(owner);
}
Destroy(this);
}and replace it with this one:
internal void OnDeath()
{
if (owner != null)
{
owner.enabled = false;
owner.npcAi = null;
UserMessage(owner.player, "ondeath");
Destroy(owner);
PetData info;
if (ins.npcSaveList.TryGetValue(owner.player.userID, out info))
{
ins.npcSaveList.Remove(owner.player.userID);
}
}
Destroy(this);
}Also, when wiping map, don't forget to remove
oxide/data/Pets_data.json