Add ctype mechanics.
This commit is contained in:
parent
c4db637887
commit
15a22c6906
@ -167,8 +167,25 @@ static int update(UPDATE_FUNC_ARGS)
|
|||||||
case PT_RSSS:
|
case PT_RSSS:
|
||||||
if(!rx && !ry)
|
if(!rx && !ry)
|
||||||
{
|
{
|
||||||
|
int ct_under, tmp_under;
|
||||||
|
|
||||||
|
ct_under = parts[ID(r)].ctype;
|
||||||
|
tmp_under = parts[ID(r)].tmp;
|
||||||
|
|
||||||
|
//If there's a correct ctype set, use it
|
||||||
|
if(ct_under > 0 && ct_under < PT_NUM)
|
||||||
|
{
|
||||||
|
sim->create_part(ID(r), x, y, ct_under);
|
||||||
|
|
||||||
|
//If there's a correct tmp set, use it for ctype
|
||||||
|
if(tmp_under > 0 && ct_under < PT_NUM)
|
||||||
|
parts[ID(r)].ctype = tmp_under;
|
||||||
|
}
|
||||||
|
else
|
||||||
sim->part_change_type(ID(r), x, y, PT_RSST);
|
sim->part_change_type(ID(r), x, y, PT_RSST);
|
||||||
|
|
||||||
sim->kill_part(i);
|
sim->kill_part(i);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -107,9 +107,25 @@ static int update(UPDATE_FUNC_ARGS)
|
|||||||
parts[i].vx = vx;
|
parts[i].vx = vx;
|
||||||
parts[i].vy = vy;
|
parts[i].vy = vy;
|
||||||
}
|
}
|
||||||
else if(TYP(r) == PT_RSST && !ry && !rx)//if on RSST
|
else if(TYP(r) == PT_RSST && !ry && !rx)//if on RSST, make it solid
|
||||||
{
|
{
|
||||||
sim->part_change_type(ID(r),x,y,PT_RSSS);
|
int ct_under, tmp_under;
|
||||||
|
|
||||||
|
ct_under = parts[ID(r)].ctype;
|
||||||
|
tmp_under = parts[ID(r)].tmp;
|
||||||
|
|
||||||
|
//If there's a correct ctype set, use it
|
||||||
|
if(ct_under > 0 && ct_under < PT_NUM)
|
||||||
|
{
|
||||||
|
sim->create_part(ID(r), x, y, ct_under);
|
||||||
|
|
||||||
|
//If there's a correct tmp set, use it for ctype
|
||||||
|
if(tmp_under > 0 && ct_under < PT_NUM)
|
||||||
|
parts[ID(r)].ctype = tmp_under;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sim->part_change_type(ID(r), x, y, PT_RSSS);
|
||||||
|
|
||||||
sim->kill_part(i);
|
sim->kill_part(i);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user