Fixes: HUD for fast PIPE, PIPE contents disappearing when next to walls, scrolling special menu, and parts_lastActiveIndex

This commit is contained in:
jacksonmj 2011-08-30 07:23:25 +08:00 committed by Simon Robertshaw
parent 323f3c1415
commit df504330e2
3 changed files with 4 additions and 5 deletions

View File

@ -130,7 +130,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{ {
r = pmap[y+ry][x+rx]; 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); np = create_part(-1,x+rx,y+ry,parts[i].tmp&0xFF);
if (np!=-1) if (np!=-1)
@ -139,8 +139,8 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
parts[np].life = parts[i].flags; parts[np].life = parts[i].flags;
parts[np].tmp = parts[i].pavg[0]; parts[np].tmp = parts[i].pavg[0];
parts[np].ctype = parts[i].pavg[1]; parts[np].ctype = parts[i].pavg[1];
parts[i].tmp &= ~0xFF;
} }
parts[i].tmp &= ~0xFF;
} }
//try eating particle at entrance //try eating particle at entrance
else if ((parts[i].tmp&0xFF) == 0 && (ptypes[r&0xFF].falldown!= 0 || ptypes[r&0xFF].state == ST_GAS)) else if ((parts[i].tmp&0xFF) == 0 && (ptypes[r&0xFF].falldown!= 0 || ptypes[r&0xFF].state == ST_GAS))

View File

@ -92,7 +92,6 @@ void menu_count(void)//puts the number of elements in each section into .itemcou
int i=0; int i=0;
msections[SC_LIFE].itemcount = NGOLALT; msections[SC_LIFE].itemcount = NGOLALT;
msections[SC_WALL].itemcount = UI_WALLCOUNT-4; msections[SC_WALL].itemcount = UI_WALLCOUNT-4;
msections[SC_SPECIAL].itemcount = 7;
for (i=0; i<PT_NUM; i++) for (i=0; i<PT_NUM; i++)
{ {
msections[ptypes[i].menusection].itemcount+=ptypes[i].menu; msections[ptypes[i].menusection].itemcount+=ptypes[i].menu;

View File

@ -2428,6 +2428,7 @@ int main(int argc, char *argv[])
for (cbi=0; cbi<NPART; cbi++) for (cbi=0; cbi<NPART; cbi++)
parts[cbi] = cb_parts[cbi]; parts[cbi] = cb_parts[cbi];
parts_lastActiveIndex = NPART-1;
for (cby = 0; cby<YRES; cby++) for (cby = 0; cby<YRES; cby++)
for (cbx = 0; cbx<XRES; cbx++) for (cbx = 0; cbx<XRES; cbx++)
@ -2592,8 +2593,7 @@ int main(int argc, char *argv[])
int tctype = parts[cr>>8].ctype; int tctype = parts[cr>>8].ctype;
if ((cr&0xFF)==PT_PIPE) if ((cr&0xFF)==PT_PIPE)
{ {
if (parts[cr>>8].tmp<PT_NUM) tctype = parts[cr>>8].tmp; tctype = parts[cr>>8].tmp&0xFF;
else tctype = 0;
} }
if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT) if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT)
tctype = 0; tctype = 0;