Jump to content

disease idx


Recommended Posts

i'm trying a mod to detect disease and filter the input content, like the liquid pipe germ detector.

my problem is when i extract the input-content.diseaseIdx, what value is considered as valid disease?

i reviewed the codes of LiquidConduitDiseaseSensorConfig -> ConduitDiseaseSensor -> ConduitThresholdSensor.ConduitUpdate()

    if (this.activateAboveThreshold)
    {
      if (((double) currentValue <= (double) this.threshold || this.IsSwitchedOn) && ((double) currentValue > (double) this.threshold || !this.IsSwitchedOn))
        return;
      this.Toggle();
    }
    else
...

 

looks like zero is considered as valid disease data.

anyone know otherwise?

 

Link to comment
https://forums.kleientertainment.com/forums/topic/117422-disease-idx/
Share on other sites

I believe the valid disease indices are 0 and 1, from WorldGen.

public static List<string> diseaseIds = new List<string>()
    {
      "FoodPoisoning",
      "SlimeLung"
    };

Also, Sim.DiseaseCell has byte.MaxValue as invalid, which could be a consideration for mod compatibility:

public static readonly Sim.DiseaseCell Invalid = new Sim.DiseaseCell()
    {
      diseaseIdx = byte.MaxValue,
      elementCount = 0
    };

 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...