diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-06-17 22:54:47 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-06-17 22:54:47 (GMT) |
| commit | c14704ae492834d9a888537b973a9b5a8585e3b3 (patch) | |
| tree | 0f5814fee18e4df51bc34d244a187fefc088cdd1 /src/powder.c | |
| parent | 06d2d5267e9d5bdd2c4546df86e06b37368d38fc (diff) | |
| download | powder-c14704ae492834d9a888537b973a9b5a8585e3b3.zip powder-c14704ae492834d9a888537b973a9b5a8585e3b3.tar.gz | |
Fix STKM causing stacking and falling through some powders
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/powder.c b/src/powder.c index 6615bbe..9dd2fd1 100644 --- a/src/powder.c +++ b/src/powder.c @@ -95,7 +95,7 @@ void init_can_move() // 1 = Swap // 2 = Both particles occupy the same space. // 3 = Varies, go run some extra checks - int t, rt; + int t, rt, stkm_move; for (rt=0;rt<PT_NUM;rt++) can_move[0][rt] = 0; // particles that don't exist shouldn't move... for (t=1;t<PT_NUM;t++) @@ -134,10 +134,14 @@ void init_can_move() { //spark shouldn't move can_move[PT_SPRK][t] = 0; - //all stickman collisions are done in stickman update function - can_move[PT_STKM][t] = 2; - can_move[PT_STKM2][t] = 2; - can_move[PT_FIGH][t] = 2; + stkm_move = 0; + if (ptypes[t].properties&TYPE_LIQUID) + stkm_move = 2; + if (!t || t==PT_PRTO || t==PT_SPAWN || t==PT_SPAWN2) + stkm_move = 2; + can_move[PT_STKM][t] = stkm_move; + can_move[PT_STKM2][t] = stkm_move; + can_move[PT_FIGH][t] = stkm_move; } for (t=0;t<PT_NUM;t++) { @@ -145,10 +149,9 @@ void init_can_move() can_move[t][PT_VOID] = 1; can_move[t][PT_BHOL] = 1; can_move[t][PT_NBHL] = 1; - //all stickman collisions are done in stickman update function - can_move[t][PT_STKM] = 2; - can_move[t][PT_STKM2] = 2; - can_move[PT_FIGH][t] = 2; + can_move[t][PT_STKM] = 0; + can_move[t][PT_STKM2] = 0; + can_move[t][PT_FIGH] = 0; //INVIS behaviour varies with pressure can_move[t][PT_INVIS] = 3; //stop CNCT being displaced by other particles @@ -1052,7 +1055,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { return -1; } - create_part(-1,x,y,PT_SPAWN); + create_part(-3,x,y,PT_SPAWN); ISSPAWN1 = 1; break; case PT_STKM2: @@ -1077,7 +1080,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { return -1; } - create_part(-1,x,y,PT_SPAWN2); + create_part(-3,x,y,PT_SPAWN2); ISSPAWN2 = 1; break; case PT_BIZR: case PT_BIZRG: case PT_BIZRS: |
