You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/powder.cpp
+3-68Lines changed: 3 additions & 68 deletions
Original file line number
Diff line number
Diff line change
@@ -876,80 +876,15 @@ void part_change_type(int i, int x, int y, int t)//changes the type of particle
876
876
globalSim->part_change_type(i, x, y, t);
877
877
}
878
878
879
-
intcreate_part(int p, int x, int y, int tv)//the function for creating a particle, use p=-1 for creating a new particle, -2 is from a brush, or a particle number to replace a particle.
879
+
//the function for creating a particle, use p=-1 for creating a new particle, -2 is from a brush, or a particle number to replace a particle.
if (p==-2 && ((globalSim->elements[type].Properties & PROP_DRAWONCTYPE) || type==PT_CRAY))
907
-
{
908
-
parts[index].ctype = PT_SPRK;
909
-
return index;
910
-
}
911
-
if (!(type == PT_INST || (ptypes[type].properties&PROP_CONDUCTS)))
912
-
return -1;
913
-
if (parts[index].life!=0)
914
-
return -1;
915
-
if (p == -2 && type == PT_INST)
916
-
{
917
-
INST_flood_spark(globalSim, x, y);
918
-
return index;
919
-
}
920
887
921
-
globalSim->spark_conductive_attempt(index, x, y);
922
-
return index;
923
-
}
924
-
if (p==-2)//creating from brush
925
-
{
926
-
if (pmap[y][x])
927
-
{
928
-
int drawOn = pmap[y][x]&0xFF;
929
-
//If an element has the PROP_DRAWONCTYPE property, and the element being drawn to it does not have PROP_NOCTYPEDRAW (Also some special cases), set the element's ctype
930
-
if (((ptypes[drawOn].properties & PROP_DRAWONCTYPE) ||
if (p==-2 && ((elements[type].Properties & PROP_DRAWONCTYPE) || type==PT_CRAY))
123
+
{
124
+
parts[index].ctype = PT_SPRK;
125
+
return index;
126
+
}
127
+
if (!(type == PT_INST || (elements[type].Properties&PROP_CONDUCTS)))
128
+
return -1;
129
+
if (parts[index].life!=0)
130
+
return -1;
131
+
if (p == -2 && type == PT_INST)
132
+
{
133
+
INST_flood_spark(this, x, y);
134
+
return index;
135
+
}
136
+
137
+
spark_conductive_attempt(index, x, y);
138
+
return index;
139
+
}
140
+
// End Spark checks
141
+
142
+
//Brush Creation
143
+
if (p == -2)
144
+
{
145
+
if (pmap[y][x])
146
+
{
147
+
int drawOn = pmap[y][x]&0xFF;
148
+
//If an element has the PROP_DRAWONCTYPE property, and the element being drawn to it does not have PROP_NOCTYPEDRAW (Also some special cases), set the element's ctype
149
+
if (((ptypes[drawOn].properties & PROP_DRAWONCTYPE) ||
0 commit comments