public override void SpawnSetup(Map map, bool respawningAfterLoad) { base.SpawnSetup(map, respawningAfterLoad); def2 = def as X2_ThingDef_AIRobot; if (def2 == null) { Log.Error("X2_AIRobot -- def2 is null. Missing class definition in xml file?"); } //InitPawn_Setup(); LongEventHandler.ExecuteWhenFinished(InitPawn_Setup); }
protected override bool Satisfied(Pawn pawn) { if (workType == null) { return(false); } X2_AIRobot robot = pawn as X2_AIRobot; if (robot == null) { return(false); } X2_ThingDef_AIRobot robotdef = robot.def as X2_ThingDef_AIRobot; if (robotdef == null) { return(false); } return(robot.CanDoWorkType(workType)); }