summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/elements/wifi.c5
-rw-r--r--src/powder.c13
2 files changed, 9 insertions, 9 deletions
diff --git a/src/elements/wifi.c b/src/elements/wifi.c
index 3e87fef..55d151d 100644
--- a/src/elements/wifi.c
+++ b/src/elements/wifi.c
@@ -12,6 +12,8 @@ int update_WIFI(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
+ // wireless[][0] - whether channel is active on this frame
+ // wireless[][1] - whether channel should be active on next frame
if (wireless[parts[i].tmp][0])
{
if (((r&0xFF)==PT_NSCN||(r&0xFF)==PT_PSCN||(r&0xFF)==PT_INWR)&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
@@ -25,9 +27,8 @@ int update_WIFI(UPDATE_FUNC_ARGS) {
{
if ((r&0xFF)==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3)
{
- wireless[parts[i].tmp][0] = 1;
wireless[parts[i].tmp][1] = 1;
- ISWIRE = 1;
+ ISWIRE = 2;
}
}
}
diff --git a/src/powder.c b/src/powder.c
index 6360529..2f42759 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1697,15 +1697,14 @@ void update_particles_i(pixel *vid, int start, int inc)
GENERATION ++;
//memset(gol2, 0, sizeof(gol2));
}
- if (ISWIRE==1)//wifi channel reseting
+ if (ISWIRE>0)//wifi channel reseting
{
for ( q = 0; q<(int)(MAX_TEMP-73.15f)/100+2; q++)
- if (!wireless[q][1])
- {
- wireless[q][0] = 0;
- }
- else
- wireless[q][1] = 0;
+ {
+ wireless[q][0] = wireless[q][1];
+ wireless[q][1] = 0;
+ }
+ ISWIRE--;
}
for (i=0; i<=parts_lastActiveIndex; i++)
if (parts[i].type)