XP Receiving - Performing Entity.Kill(); on partially looted crates

As title says. Players report crates disappearing when they stop looting them while there is still loot inside.

Issue: XPReceiving.cs - Line 157 "private void OnLooted(LootContainer entity, BasePlayer player)"

There does not seem to be any check within this function to see if the container is empty before it performs Entity.Kill(); on the container being looted.

This means players are losing loot if they do not fully loot the container in one go. Am I correct? If so, could you possibly add a check for items before killing the container?

I tried editing it to something like this but it still didn't work,

if (entity.inventory.itemList.Count != 0)
{
return;
}
entity.Kill();
AddXP(player, xp, "Loot");

Could you please look into this as it's a pretty serious issue with people losing loot from all crates, thanks man :)
 
Yeah i used it long time ago idk why. I will remove it in next update

I'm confused, you will remove what?

What I would like is for the plugin to check the container is empty before it calls entity.kill(); and adds XP.

So as I see it, a check needs to be added (not removed) in the OnLooted function to make sure the container is empty before calling entity.kill();

Hopefully you understand what I am trying to explain? Currently the XP system cannot be used as this breaks looting all containers unless you empty in one go.
 

Orange

Administrator
I'm confused, you will remove what?

What I would like is for the plugin to check the container is empty before it calls entity.kill(); and adds XP.

So as I see it, a check needs to be added (not removed) in the OnLooted function to make sure the container is empty before calling entity.kill();

Hopefully you understand what I am trying to explain? Currently the XP system cannot be used as this breaks looting all containers unless you empty in one go.
Yes, i will remove it
 
Top