summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2012-07-09 19:09:29 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2012-07-09 19:09:29 (GMT)
commit61f39f5464f4f5d39c76f8427127e8998cc8e618 (patch)
tree54b17c4f7d792aa172b22b83ff8a972b4deaa9cd /src/main.c
parent3e1d3cd5a6382f1ad7dacee48cfee04188601670 (diff)
downloadpowder-61f39f5464f4f5d39c76f8427127e8998cc8e618.zip
powder-61f39f5464f4f5d39c76f8427127e8998cc8e618.tar.gz
Add ptypes.enabled checks to a few more places
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 4aae2f4..ec11223 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1548,7 +1548,7 @@ int main(int argc, char *argv[])
for (i=0; i<NPART; i++)
if (parts[i].type==PT_SPRK)
{
- if (parts[i].ctype >= 0 && parts[i].ctype < PT_NUM)
+ if (parts[i].ctype >= 0 && parts[i].ctype < PT_NUM && ptypes[parts[i].ctype].enabled)
{
parts[i].type = parts[i].ctype;
parts[i].life = 0;
@@ -2797,14 +2797,14 @@ int main(int argc, char *argv[])
//Setting an element for the stick man
if (player.spwn==0)
{
- if ((sr<PT_NUM && ptypes[sr].falldown>0) || sr==SPC_AIR || sr == PT_NEUT || sr == PT_PHOT || sr == PT_LIGH)
+ if ((sr>0 && sr<PT_NUM && ptypes[sr].enabled && ptypes[sr].falldown>0) || sr==SPC_AIR || sr == PT_NEUT || sr == PT_PHOT || sr == PT_LIGH)
player.elem = sr;
else
player.elem = PT_DUST;
}
if (player2.spwn==0)
{
- if ((sr<PT_NUM && ptypes[sr].falldown>0) || sr==SPC_AIR || sr == PT_NEUT || sr == PT_PHOT || sr == PT_LIGH)
+ if ((sr>0 && sr<PT_NUM && ptypes[sr].enabled && ptypes[sr].falldown>0) || sr==SPC_AIR || sr == PT_NEUT || sr == PT_PHOT || sr == PT_LIGH)
player2.elem = sr;
else
player2.elem = PT_DUST;