Still use max zap setting for some punishments even if step is disabled
This commit is contained in:
+3
-4
@@ -300,12 +300,11 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
apply_uint8_from_tuple(iter, MESSAGE_KEY_PKJS_PAVLOK_ZAP_MAX, &settings.PavlokMax);
|
||||
apply_uint8_from_tuple(iter, MESSAGE_KEY_PKJS_AWARENESS_TIME_GAP, &settings.AwarenessTimeGapMinutes);
|
||||
apply_uint8_from_tuple(iter, MESSAGE_KEY_PKJS_AWARENESS_TIME_LIMIT, &settings.AwarenessTimeLimitSeconds);
|
||||
if (settings.PavlokStep == 0) {
|
||||
// match min and max values if disabling step mode, as the max is used for force exit/overwrite punishments
|
||||
settings.PavlokMax = settings.PavlokMin;
|
||||
} else if (settings.PavlokMax <= settings.PavlokMin) {
|
||||
if (settings.PavlokMax <= settings.PavlokMin) {
|
||||
// disable step mode if max is not higher than min
|
||||
settings.PavlokStep = 0;
|
||||
// ensure force quit/overwrite punishments aren't weaker than base
|
||||
settings.PavlokMax = settings.PavlokMin;
|
||||
}
|
||||
persist_write_data(STORAGE_KEY_SETTINGS, &settings, sizeof(settings));
|
||||
}
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ module.exports = [
|
||||
"max": 100,
|
||||
"step": 5,
|
||||
"label": "Zap Intensity (Base)",
|
||||
"description": "% intensity of base zap."
|
||||
"description": "% intensity of base zap. Used for awareness alarm zaps."
|
||||
},
|
||||
{
|
||||
"id": "pavlok_zap_step",
|
||||
@@ -51,7 +51,7 @@ module.exports = [
|
||||
"max": 100,
|
||||
"step": 5,
|
||||
"label": "Zap Step",
|
||||
"description": "% to increase base zap intensity by after each failed awareness alarm; set to 0 to disable."
|
||||
"description": "% to increment base zap intensity after each failed awareness alarm; set to 0 to disable."
|
||||
},
|
||||
{
|
||||
"id": "pavlok_zap_max",
|
||||
@@ -62,7 +62,7 @@ module.exports = [
|
||||
"max": 100,
|
||||
"step": 5,
|
||||
"label": "Zap Intensity (Max)",
|
||||
"description": "% intensity of maximum zap; only takes effect if greater than base and step is enabled. Also used for force exit/alarm overwrite penalties."
|
||||
"description": "% intensity of max zap; only takes effect if greater than base. Used for force exit/alarm overwrite penalties, as well as max value to step to in awareness alarms if zap step is enabled."
|
||||
},
|
||||
{
|
||||
"id": "pavlok_zap_interval",
|
||||
|
||||
Reference in New Issue
Block a user