再修动物

This commit is contained in:
2025-09-19 20:35:47 +08:00
parent 5f63216c5d
commit 5bd9197d0a
2 changed files with 17 additions and 2 deletions

Binary file not shown.

View File

@@ -121,13 +121,28 @@ namespace ArachnaeSwarm
var currentMealDef = dispenser.DispensableDef;
if (currentMealDef == null) continue;
// Use the game's built-in social properness check.
// This correctly handles colonists, prisoners, visitors, and animals (wild vs tame).
// --- Start of refined access checks ---
// 1. Block hostile pawns.
if (getter.HostileTo(Faction.OfPlayer))
{
continue;
}
// 2. Block wild animals. Tamed player-faction animals are allowed.
if (getter.RaceProps.Animal && getter.Faction != Faction.OfPlayer)
{
continue;
}
// 3. Use the game's built-in social properness check for things like prisoner access.
if (!dispenser.IsSociallyProper(getter))
{
continue;
}
// --- End of refined access checks ---
// Check if the dispenser is usable
if (!dispenser.CanDispenseNow || dispenser.IsForbidden(getter) || !eater.WillEat(currentMealDef, getter))
{