summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-08-29 23:23:25 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-08-30 11:34:28 (GMT)
commitdf504330e274a21e841d9457d4f1847438f2dde8 (patch)
treef55f29194ddb9923da5ed0d73dfa09d79a9cfee1 /src
parent323f3c1415a4322b212bdee063f6bf910a6f2d12 (diff)
downloadpowder-df504330e274a21e841d9457d4f1847438f2dde8.zip
powder-df504330e274a21e841d9457d4f1847438f2dde8.tar.gz
Fixes: HUD for fast PIPE, PIPE contents disappearing when next to walls, scrolling special menu, and parts_lastActiveIndex
Diffstat (limited to 'src')
-rw-r--r--src/elements/pipe.c4
-rw-r--r--src/interface.c1
-rw-r--r--src/main.c4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/elements/pipe.c b/src/elements/pipe.c
index 9e060b5..6b5a508 100644
--- a/src/elements/pipe.c
+++ b/src/elements/pipe.c
@@ -130,7 +130,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = pmap[y+ry][x+rx];
- if (surround_space && !r && (parts[i].tmp&0xFF)!=0) //creating at end
+ if (surround_space && !r && (parts[i].tmp&0xFF)!=0 && eval_move(parts[i].tmp&0xFF, x+rx, y+ry, NULL)) //creating at end
{
np = create_part(-1,x+rx,y+ry,parts[i].tmp&0xFF);
if (np!=-1)
@@ -139,8 +139,8 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
parts[np].life = parts[i].flags;
parts[np].tmp = parts[i].pavg[0];
parts[np].ctype = parts[i].pavg[1];
+ parts[i].tmp &= ~0xFF;
}
- parts[i].tmp &= ~0xFF;
}
//try eating particle at entrance
else if ((parts[i].tmp&0xFF) == 0 && (ptypes[r&0xFF].falldown!= 0 || ptypes[r&0xFF].state == ST_GAS))
diff --git a/src/interface.c b/src/interface.c
index 9018888..5f78eed 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -92,7 +92,6 @@ void menu_count(void)//puts the number of elements in each section into .itemcou
int i=0;
msections[SC_LIFE].itemcount = NGOLALT;
msections[SC_WALL].itemcount = UI_WALLCOUNT-4;
- msections[SC_SPECIAL].itemcount = 7;
for (i=0; i<PT_NUM; i++)
{
msections[ptypes[i].menusection].itemcount+=ptypes[i].menu;
diff --git a/src/main.c b/src/main.c
index 69bb66f..1ca9b6c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2428,6 +2428,7 @@ int main(int argc, char *argv[])
for (cbi=0; cbi<NPART; cbi++)
parts[cbi] = cb_parts[cbi];
+ parts_lastActiveIndex = NPART-1;
for (cby = 0; cby<YRES; cby++)
for (cbx = 0; cbx<XRES; cbx++)
@@ -2592,8 +2593,7 @@ int main(int argc, char *argv[])
int tctype = parts[cr>>8].ctype;
if ((cr&0xFF)==PT_PIPE)
{
- if (parts[cr>>8].tmp<PT_NUM) tctype = parts[cr>>8].tmp;
- else tctype = 0;
+ tctype = parts[cr>>8].tmp&0xFF;
}
if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT)
tctype = 0;