diff --git a/src/src/cavg.cc b/src/src/cavg.cc index 3bfb9d33..59abb4cd 100644 --- a/src/src/cavg.cc +++ b/src/src/cavg.cc @@ -16,7 +16,7 @@ cavg::solve_electronics() this->value = f * this->value + (1.f - f)*v; } - this->s_out[0].write(this->value); + this->s_out[0].write(tclampf(this->value, 0.f, 1.f)); return 0; } diff --git a/src/src/ceilgate.cc b/src/src/ceilgate.cc index 0113d335..dff42f70 100644 --- a/src/src/ceilgate.cc +++ b/src/src/ceilgate.cc @@ -8,7 +8,7 @@ ceilgate::solve_electronics() float v = ceilf(this->s_in[0].get_value()); - this->s_out[0].write(v); + this->s_out[0].write(tclampf(v, 0.f, 1.f)); return 0; } diff --git a/src/src/floorgate.cc b/src/src/floorgate.cc index 59e02f5c..7177c9d9 100644 --- a/src/src/floorgate.cc +++ b/src/src/floorgate.cc @@ -8,7 +8,7 @@ integergate::solve_electronics() float v = (float)((int)this->s_in[0].get_value()); - this->s_out[0].write(v); + this->s_out[0].write(tclampf(v, 0.f, 1.f)); return 0; } diff --git a/src/src/i2o1gate.cc b/src/src/i2o1gate.cc index e68ddc7a..d350dbc3 100644 --- a/src/src/i2o1gate.cc +++ b/src/src/i2o1gate.cc @@ -226,7 +226,7 @@ emin::solve_electronics() float a = this->s_in[0].get_value(); float b = this->s_in[1].get_value(); - this->s_out[0].write(!(bs_out[0].write(tclampf(!(b < a) ? a : b, 0.f, 1.f)); return 0; } @@ -242,7 +242,7 @@ emax::solve_electronics() float a = this->s_in[0].get_value(); float b = this->s_in[1].get_value(); - this->s_out[0].write((as_out[0].write(tclampf((a < b) ? b : a, 0.f, 1.f)); return 0; } @@ -308,7 +308,7 @@ hp_control::solve_electronics() } } - this->s_out[0].write(hp / this->target->get_max_hp()); + this->s_out[0].write(tclampf(hp / this->target->get_max_hp(), 0.f, 1.f)); } else { this->s_out[0].write(0.f); } diff --git a/src/src/mavg.cc b/src/src/mavg.cc index 772186fd..5f8f3f7c 100644 --- a/src/src/mavg.cc +++ b/src/src/mavg.cc @@ -23,7 +23,7 @@ mavg::solve_electronics() float f = this->properties[0].v.f; this->value = f * this->value + (1.f - f)*v; - this->s_out[0].write(this->value); + this->s_out[0].write(tclampf(this->value, 0.f, 1.f)); return 0; } diff --git a/src/src/snapgate.cc b/src/src/snapgate.cc index 83582496..c12b1de1 100644 --- a/src/src/snapgate.cc +++ b/src/src/snapgate.cc @@ -23,7 +23,7 @@ snapgate::solve_electronics() v = roundf(v); v *= snap; - this->s_out[0].write(v); + this->s_out[0].write(tclampf(v, 0.f, 1.f)); return 0; }