Move LOLZ/LOVE Rule tables into more appropriate location (element file)
This commit is contained in:
parent
d159467b63
commit
774bc08c2c
@ -3311,11 +3311,11 @@ void Simulation::update_particles_i(int start, int inc)
|
|||||||
if (ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
|
if (ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
|
||||||
{
|
{
|
||||||
rt=pmap[ny+nny][nx+nnx];
|
rt=pmap[ny+nny][nx+nnx];
|
||||||
if (!rt&&loverule[nnx][nny]==1)
|
if (!rt&&Element_LOVE::RuleTable[nnx][nny]==1)
|
||||||
create_part(-1,nx+nnx,ny+nny,PT_LOVE);
|
create_part(-1,nx+nnx,ny+nny,PT_LOVE);
|
||||||
else if (!rt)
|
else if (!rt)
|
||||||
continue;
|
continue;
|
||||||
else if (parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0)
|
else if (parts[rt>>8].type==PT_LOVE&&Element_LOVE::RuleTable[nnx][nny]==0)
|
||||||
kill_part(rt>>8);
|
kill_part(rt>>8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3329,11 +3329,11 @@ void Simulation::update_particles_i(int start, int inc)
|
|||||||
if (ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
|
if (ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
|
||||||
{
|
{
|
||||||
rt=pmap[ny+nny][nx+nnx];
|
rt=pmap[ny+nny][nx+nnx];
|
||||||
if (!rt&&lolzrule[nny][nnx]==1)
|
if (!rt&&Element_LOLZ::RuleTable[nny][nnx]==1)
|
||||||
create_part(-1,nx+nnx,ny+nny,PT_LOLZ);
|
create_part(-1,nx+nnx,ny+nny,PT_LOLZ);
|
||||||
else if (!rt)
|
else if (!rt)
|
||||||
continue;
|
continue;
|
||||||
else if (parts[rt>>8].type==PT_LOLZ&&lolzrule[nny][nnx]==0)
|
else if (parts[rt>>8].type==PT_LOLZ&&Element_LOLZ::RuleTable[nny][nnx]==0)
|
||||||
kill_part(rt>>8);
|
kill_part(rt>>8);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -4747,29 +4747,4 @@ Simulation::Simulation():
|
|||||||
clear_sim();
|
clear_sim();
|
||||||
|
|
||||||
grav->gravity_mask();
|
grav->gravity_mask();
|
||||||
|
|
||||||
int loverule[9][9] =
|
|
||||||
{
|
|
||||||
{0,0,1,1,0,0,0,0,0},
|
|
||||||
{0,1,0,0,1,1,0,0,0},
|
|
||||||
{1,0,0,0,0,0,1,0,0},
|
|
||||||
{1,0,0,0,0,0,0,1,0},
|
|
||||||
{0,1,0,0,0,0,0,0,1},
|
|
||||||
{1,0,0,0,0,0,0,1,0},
|
|
||||||
{1,0,0,0,0,0,1,0,0},
|
|
||||||
{0,1,0,0,1,1,0,0,0},
|
|
||||||
{0,0,1,1,0,0,0,0,0},
|
|
||||||
};
|
|
||||||
int lolzrule[9][9] =
|
|
||||||
{
|
|
||||||
{0,0,0,0,0,0,0,0,0},
|
|
||||||
{1,0,0,0,0,0,1,0,0},
|
|
||||||
{1,0,0,0,0,0,1,0,0},
|
|
||||||
{1,0,0,1,1,0,0,1,0},
|
|
||||||
{1,0,1,0,0,1,0,1,0},
|
|
||||||
{1,0,1,0,0,1,0,1,0},
|
|
||||||
{0,1,0,1,1,0,0,1,0},
|
|
||||||
{0,1,0,0,0,0,0,1,0},
|
|
||||||
{0,1,0,0,0,0,0,1,0},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,20 @@ Element_LOLZ::Element_LOLZ()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#TPT-Directive ElementHeader Element_LOLZ static int RuleTable[9][9]
|
||||||
|
int Element_LOLZ::RuleTable[9][9] =
|
||||||
|
{
|
||||||
|
{0,0,0,0,0,0,0,0,0},
|
||||||
|
{1,0,0,0,0,0,1,0,0},
|
||||||
|
{1,0,0,0,0,0,1,0,0},
|
||||||
|
{1,0,0,1,1,0,0,1,0},
|
||||||
|
{1,0,1,0,0,1,0,1,0},
|
||||||
|
{1,0,1,0,0,1,0,1,0},
|
||||||
|
{0,1,0,1,1,0,0,1,0},
|
||||||
|
{0,1,0,0,0,0,0,1,0},
|
||||||
|
{0,1,0,0,0,0,0,1,0},
|
||||||
|
};
|
||||||
|
|
||||||
//#TPT-Directive ElementHeader Element_LOLZ static int update(UPDATE_FUNC_ARGS)
|
//#TPT-Directive ElementHeader Element_LOLZ static int update(UPDATE_FUNC_ARGS)
|
||||||
int Element_LOLZ::update(UPDATE_FUNC_ARGS)
|
int Element_LOLZ::update(UPDATE_FUNC_ARGS)
|
||||||
{
|
{
|
||||||
|
@ -46,6 +46,20 @@ Element_LOVE::Element_LOVE()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#TPT-Directive ElementHeader Element_LOVE static int RuleTable[9][9]
|
||||||
|
int Element_LOVE::RuleTable[9][9] =
|
||||||
|
{
|
||||||
|
{0,0,1,1,0,0,0,0,0},
|
||||||
|
{0,1,0,0,1,1,0,0,0},
|
||||||
|
{1,0,0,0,0,0,1,0,0},
|
||||||
|
{1,0,0,0,0,0,0,1,0},
|
||||||
|
{0,1,0,0,0,0,0,0,1},
|
||||||
|
{1,0,0,0,0,0,0,1,0},
|
||||||
|
{1,0,0,0,0,0,1,0,0},
|
||||||
|
{0,1,0,0,1,1,0,0,0},
|
||||||
|
{0,0,1,1,0,0,0,0,0},
|
||||||
|
};
|
||||||
|
|
||||||
//#TPT-Directive ElementHeader Element_LOVE static int update(UPDATE_FUNC_ARGS)
|
//#TPT-Directive ElementHeader Element_LOVE static int update(UPDATE_FUNC_ARGS)
|
||||||
int Element_LOVE::update(UPDATE_FUNC_ARGS)
|
int Element_LOVE::update(UPDATE_FUNC_ARGS)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user