summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-09 21:12:25 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-09 21:12:25 (GMT)
commit88d107f18a9c6d37493a953142a503d963ec37b1 (patch)
treeb2a90a8127c977534cbd258a7d9e985ee23f9d40 /src/elements
parent6094753eb18fd315acd0eaecaaf19ecf609acfbe (diff)
downloadpowder-88d107f18a9c6d37493a953142a503d963ec37b1.zip
powder-88d107f18a9c6d37493a953142a503d963ec37b1.tar.gz
Better channel handling
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/prti.c6
-rw-r--r--src/elements/prto.c6
-rw-r--r--src/elements/wifi.c6
3 files changed, 6 insertions, 12 deletions
diff --git a/src/elements/prti.c b/src/elements/prti.c
index 33b449f..ff9f459 100644
--- a/src/elements/prti.c
+++ b/src/elements/prti.c
@@ -1,11 +1,9 @@
#include <powder.h>
int update_PRTI(UPDATE_FUNC_ARGS) {
- int r, temp, nnx, temprange = 100;
+ int r, nnx;
int count =0;
- for ( temp = 0; temp < MAX_TEMP; temp += temprange)
- if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
- parts[i].tmp = temp/100;
+ parts[i].tmp = (int)((parts[i].temp-73.15f)/100+1);
for (ny=-1; ny<2; ny++)
for (nx=-1; nx<2; nx++)
if (x+nx>=0 && y+ny>0 &&
diff --git a/src/elements/prto.c b/src/elements/prto.c
index f7f97fc..acaa689 100644
--- a/src/elements/prto.c
+++ b/src/elements/prto.c
@@ -1,11 +1,9 @@
#include <powder.h>
int update_PRTO(UPDATE_FUNC_ARGS) {
- int r, temp, nnx, temprange = 100;
+ int r, nnx;
int count = 0;
- for ( temp = 0; temp < MAX_TEMP; temp += temprange)
- if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
- parts[i].tmp = temp/100;
+ parts[i].tmp = (int)((parts[i].temp-73.15f)/100+1);
for (ny=1; ny>-2; ny--)
for (nx=1; nx>-2; nx--)
if (x+nx>=0 && y+ny>0 &&
diff --git a/src/elements/wifi.c b/src/elements/wifi.c
index fb1a522e..6584a00 100644
--- a/src/elements/wifi.c
+++ b/src/elements/wifi.c
@@ -1,10 +1,8 @@
#include <powder.h>
int update_WIFI(UPDATE_FUNC_ARGS) {
- int r, rx, ry, temp, temprange = 100;
- for ( temp = 0; temp < MAX_TEMP; temp += temprange)
- if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
- parts[i].tmp = temp/100;
+ int r, rx, ry;
+ parts[i].tmp = (int)((parts[i].temp-73.15f)/100+1);
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))