Remember ctype when cloning lava
This commit is contained in:
parent
3c14787064
commit
7707943981
@ -38,18 +38,26 @@ int update_BCLN(UPDATE_FUNC_ARGS) {
|
|||||||
continue;
|
continue;
|
||||||
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
|
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
|
||||||
(r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
|
(r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
|
||||||
(r&0xFF)!=PT_STKM2 && (r&0xFF)!=PT_PBCN &&
|
(r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
|
||||||
(r&0xFF)<PT_NUM)
|
(r&0xFF)<PT_NUM)
|
||||||
{
|
{
|
||||||
parts[i].ctype = r&0xFF;
|
parts[i].ctype = r&0xFF;
|
||||||
if ((r&0xFF)==PT_LIFE)
|
if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
|
||||||
parts[i].tmp = parts[r>>8].ctype;
|
parts[i].tmp = parts[r>>8].ctype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (parts[i].ctype==PT_LIFE) create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8));
|
if (parts[i].ctype==PT_LIFE) create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8));
|
||||||
else create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
else
|
||||||
|
{
|
||||||
|
int np = create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
||||||
|
if (np>=0)
|
||||||
|
{
|
||||||
|
if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && ptransitions[parts[i].tmp].tht==PT_LAVA)
|
||||||
|
parts[np].ctype = parts[i].tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -34,14 +34,22 @@ int update_CLNE(UPDATE_FUNC_ARGS) {
|
|||||||
(r&0xFF)<PT_NUM)
|
(r&0xFF)<PT_NUM)
|
||||||
{
|
{
|
||||||
parts[i].ctype = r&0xFF;
|
parts[i].ctype = r&0xFF;
|
||||||
if ((r&0xFF)==PT_LIFE)
|
if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
|
||||||
parts[i].tmp = parts[r>>8].ctype;
|
parts[i].tmp = parts[r>>8].ctype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (parts[i].ctype==PT_LIFE) create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8));
|
if (parts[i].ctype==PT_LIFE) create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8));
|
||||||
else create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
else
|
||||||
|
{
|
||||||
|
int np = create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
||||||
|
if (np>=0)
|
||||||
|
{
|
||||||
|
if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && ptransitions[parts[i].tmp].tht==PT_LAVA)
|
||||||
|
parts[np].ctype = parts[i].tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ int update_PBCN(UPDATE_FUNC_ARGS) {
|
|||||||
(r&0xFF)!=PT_PBCN && (r&0xFF)<PT_NUM)
|
(r&0xFF)!=PT_PBCN && (r&0xFF)<PT_NUM)
|
||||||
{
|
{
|
||||||
parts[i].ctype = r&0xFF;
|
parts[i].ctype = r&0xFF;
|
||||||
if ((r&0xFF)==PT_LIFE)
|
if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
|
||||||
parts[i].tmp = parts[r>>8].ctype;
|
parts[i].tmp = parts[r>>8].ctype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,8 +100,15 @@ int update_PBCN(UPDATE_FUNC_ARGS) {
|
|||||||
create_part(-1, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8));
|
create_part(-1, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
else
|
||||||
|
{
|
||||||
|
int np = create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
||||||
|
if (np>=0)
|
||||||
|
{
|
||||||
|
if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && ptransitions[parts[i].tmp].tht==PT_LAVA)
|
||||||
|
parts[np].ctype = parts[i].tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -58,7 +58,7 @@ int update_PCLN(UPDATE_FUNC_ARGS) {
|
|||||||
(r&0xFF)!=PT_PBCN && (r&0xFF)<PT_NUM)
|
(r&0xFF)!=PT_PBCN && (r&0xFF)<PT_NUM)
|
||||||
{
|
{
|
||||||
parts[i].ctype = r&0xFF;
|
parts[i].ctype = r&0xFF;
|
||||||
if ((r&0xFF)==PT_LIFE)
|
if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
|
||||||
parts[i].tmp = parts[r>>8].ctype;
|
parts[i].tmp = parts[r>>8].ctype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,8 +90,15 @@ int update_PCLN(UPDATE_FUNC_ARGS) {
|
|||||||
create_part(-1, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8));
|
create_part(-1, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
else
|
||||||
|
{
|
||||||
|
int np = create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
|
||||||
|
if (np>=0)
|
||||||
|
{
|
||||||
|
if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && ptransitions[parts[i].tmp].tht==PT_LAVA)
|
||||||
|
parts[np].ctype = parts[i].tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user