再修动物
This commit is contained in:
Binary file not shown.
@@ -121,13 +121,28 @@ namespace ArachnaeSwarm
|
|||||||
var currentMealDef = dispenser.DispensableDef;
|
var currentMealDef = dispenser.DispensableDef;
|
||||||
if (currentMealDef == null) continue;
|
if (currentMealDef == null) continue;
|
||||||
|
|
||||||
// Use the game's built-in social properness check.
|
// --- Start of refined access checks ---
|
||||||
// This correctly handles colonists, prisoners, visitors, and animals (wild vs tame).
|
|
||||||
|
// 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))
|
if (!dispenser.IsSociallyProper(getter))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- End of refined access checks ---
|
||||||
|
|
||||||
// Check if the dispenser is usable
|
// Check if the dispenser is usable
|
||||||
if (!dispenser.CanDispenseNow || dispenser.IsForbidden(getter) || !eater.WillEat(currentMealDef, getter))
|
if (!dispenser.CanDispenseNow || dispenser.IsForbidden(getter) || !eater.WillEat(currentMealDef, getter))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user