Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:13:32 +09:30
commit 7345f42201
470 changed files with 51966 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
public class InventorySlotGurad
{
public int Slot { get; private set; } = -1;
#if NotEditor
public bool IsValid(EntityAlive entity)
{
if (entity && entity.inventory != null)
{
if (Slot < 0)
{
Slot = entity.inventory.holdingItemIdx;
return true;
}
if (Slot != entity.inventory.holdingItemIdx)
{
Log.Warning($"trying to set ammo for slot {Slot} while holding slot {entity.inventory.holdingItemIdx} on entity {entity.entityId}!");
return false;
}
return true;
}
return false;
}
#endif
}