summaryrefslogtreecommitdiff
path: root/src/elements/sing.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-11-21 00:48:39 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-21 00:48:39 (GMT)
commit876c861c425ad424ffc5af4bf39b2a3441b50f9a (patch)
tree2140759c599a763e9887bd3a0ee119fbeb37ef33 /src/elements/sing.c
parent8c6e7caaff883f9c7df111df65737547bd280c7a (diff)
downloadpowder-876c861c425ad424ffc5af4bf39b2a3441b50f9a.zip
powder-876c861c425ad424ffc5af4bf39b2a3441b50f9a.tar.gz
Fix LCRY/ELEC infinite loop, BIZR turns photons into electrons, SING explodes with electrons, electrons react with deut.
Diffstat (limited to 'src/elements/sing.c')
-rw-r--r--src/elements/sing.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/elements/sing.c b/src/elements/sing.c
index 1f463bf..d6fc273 100644
--- a/src/elements/sing.c
+++ b/src/elements/sing.c
@@ -40,10 +40,17 @@ int update_SING(UPDATE_FUNC_ARGS) {
spawncount = spawncount*spawncount*M_PI;
for (j=0;j<spawncount;j++)
{
- if (rand()%2) {
- nb = create_part(-3, x, y, PT_PHOT);
- } else {
- nb = create_part(-3, x, y, PT_NEUT);
+ switch(rand()%3)
+ {
+ case 0:
+ nb = create_part(-3, x, y, PT_PHOT);
+ break;
+ case 1:
+ nb = create_part(-3, x, y, PT_NEUT);
+ break;
+ case 2:
+ nb = create_part(-3, x, y, PT_ELEC);
+ break;
}
if (nb!=-1) {
parts[nb].life = (rand()%300);