Model upd refs do not apply offset on custom clear

This commit is contained in:
elecpower
2020-09-19 21:07:20 +10:00
parent 26b7f26660
commit ff64a949a5
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -847,7 +847,7 @@ void ModelData::updateTypeIndexRef(R & curRef, const T type, const int idxAdj, c
newRef.clear(); newRef.clear();
else { else {
newRef.type = (T)defType; newRef.type = (T)defType;
newRef.index = defIndex + idxAdj; newRef.index = defIndex;
} }
break; break;
case REF_UPD_ACT_SHIFT: case REF_UPD_ACT_SHIFT:
@@ -904,7 +904,7 @@ void ModelData::updateTypeValueRef(R & curRef, const T type, const int idxAdj, c
newRef.clear(); newRef.clear();
else { else {
newRef.type = (T)defType; newRef.type = (T)defType;
newRef.value = defValue + idxAdj; newRef.value = defValue;
} }
break; break;
case REF_UPD_ACT_SHIFT: case REF_UPD_ACT_SHIFT:
+1 -1
View File
@@ -321,7 +321,7 @@ class ModelData {
void updateModuleFailsafes(ModuleData * md); void updateModuleFailsafes(ModuleData * md);
inline void updateSourceRef(RawSource & src) { updateTypeIndexRef<RawSource, RawSourceType>(src, updRefInfo.srcType); } inline void updateSourceRef(RawSource & src) { updateTypeIndexRef<RawSource, RawSourceType>(src, updRefInfo.srcType); }
inline void updateSwitchRef(RawSwitch & swtch) { updateTypeIndexRef<RawSwitch, RawSwitchType>(swtch, updRefInfo.swtchType, 1); } inline void updateSwitchRef(RawSwitch & swtch) { updateTypeIndexRef<RawSwitch, RawSwitchType>(swtch, updRefInfo.swtchType, 1); }
inline void updateTimerMode(RawSwitch & swtch) { updateTypeIndexRef<RawSwitch, RawSwitchType>(swtch, updRefInfo.swtchType, 1, false, (int)SWITCH_TYPE_TIMER_MODE, -1 /*adjusted by offset*/); } inline void updateTimerMode(RawSwitch & swtch) { updateTypeIndexRef<RawSwitch, RawSwitchType>(swtch, updRefInfo.swtchType, 1, false, (int)SWITCH_TYPE_TIMER_MODE, 0); }
inline void updateSourceIntRef(int & value) inline void updateSourceIntRef(int & value)
{ {
RawSource src = RawSource(value); RawSource src = RawSource(value);