From 77079439819dca2da9a3dda9120ea304e5e2d4fb Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 10 Jun 2012 22:53:40 +0100 Subject: [PATCH] Remember ctype when cloning lava --- src/elements/bcln.c | 14 +++++++++++--- src/elements/clne.c | 12 ++++++++++-- src/elements/pbcn.c | 13 ++++++++++--- src/elements/pcln.c | 13 ++++++++++--- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/elements/bcln.c b/src/elements/bcln.c index 328fc6e9a..91dac12d2 100644 --- a/src/elements/bcln.c +++ b/src/elements/bcln.c @@ -38,18 +38,26 @@ int update_BCLN(UPDATE_FUNC_ARGS) { continue; if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (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)>8].ctype; } } } 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)); - 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>8].ctype; } } } 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)); - 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>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)); } } - } 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>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)); } } - } 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