Skip to content

Commit

Permalink
fix PLSM spawning in fusion (allow some stacking), GRVT in O2 fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Dec 15, 2014
1 parent 35782fd commit 0f583f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
12 changes: 8 additions & 4 deletions src/simulation/elements/H2.cpp
Expand Up @@ -117,11 +117,15 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
parts[j].temp = temp;
parts[j].tmp = 0x1;
}
j = sim->create_part(-1,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
if (j>-1)
rx = x+rand()%3-1, ry = y+rand()%3-1, rt = pmap[ry][rx]&0xFF;
if (sim->can_move[PT_PLSM][rt] || rt == PT_H2)
{
parts[j].temp = temp;
parts[j].tmp |= 4;
j = sim->create_part(-3,rx,ry,PT_PLSM);
if (j>-1)
{
parts[j].temp = temp;
parts[j].tmp |= 4;
}
}
parts[i].temp = temp+750+rand()%500;
sim->pv[y/CELL][x/CELL] += 30;
Expand Down
12 changes: 8 additions & 4 deletions src/simulation/elements/NBLE.cpp
Expand Up @@ -74,11 +74,15 @@ int Element_NBLE::update(UPDATE_FUNC_ARGS)
parts[j].temp = temp;
parts[j].tmp = 0x1;
}
j = sim->create_part(-1,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
if (j != -1)
int rx = x+rand()%3-1, ry = y+rand()%3-1, rt = pmap[ry][rx]&0xFF;
if (sim->can_move[PT_PLSM][rt] || rt == PT_NBLE)
{
parts[j].temp = temp;
parts[j].tmp |= 4;
j = sim->create_part(-3,rx,ry,PT_PLSM);
if (j != -1)
{
parts[j].temp = temp;
parts[j].tmp |= 4;
}
}
parts[i].temp = temp+1750+rand()%500;
sim->pv[y/CELL][x/CELL] += 50;
Expand Down
15 changes: 11 additions & 4 deletions src/simulation/elements/O2.cpp
Expand Up @@ -92,12 +92,19 @@ int Element_O2::update(UPDATE_FUNC_ARGS)
parts[j].temp = MAX_TEMP;
parts[j].tmp = 0x1;
}
j = sim->create_part(-1,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
if (j != -1)
rx = x+rand()%3-1, ry = y+rand()%3-1, r = pmap[ry][rx]&0xFF;
if (sim->can_move[PT_PLSM][r] || r == PT_O2)
{
parts[j].temp = MAX_TEMP;
parts[j].tmp |= 4;
j = sim->create_part(-3,rx,ry,PT_PLSM);
if (j > -1)
{
parts[j].temp = MAX_TEMP;
parts[j].tmp |= 4;
}
}
j = sim->create_part(-3,x,y,PT_GRVT);
if (j != -1)
parts[j].temp = MAX_TEMP;
parts[i].temp = MAX_TEMP;
sim->pv[y/CELL][x/CELL] = 256;
}
Expand Down

0 comments on commit 0f583f3

Please sign in to comment.