kelmen Posted April 18, 2020 Share Posted April 18, 2020 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 Share on other sites More sharing options...
Versepelles Posted April 20, 2020 Share Posted April 20, 2020 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 }; Link to comment Share on other sites More sharing options...
Recommended Posts
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.