this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fixed crash when fusing vertices

clover 09231158 5ab608f9

+40 -4
+8
CHANGELOG.md
··· 1 + # Changelog 2 + 3 + All notable changes to this project will be documented in this file. 4 + 5 + ## Next Release 6 + 7 + ### Fixed 8 + - (Map Editor) Fixed crash when fusing vertices
+27
src/main/java/common/Vector3f.java
··· 146 146 { 147 147 return "(" + x + ", " + y + ", " + z + ")"; 148 148 } 149 + 150 + @Override 151 + public int hashCode() 152 + { 153 + final int prime = 31; 154 + int result = 1; 155 + result = prime * result + Float.floatToIntBits(x); 156 + result = prime * result + Float.floatToIntBits(y); 157 + result = prime * result + Float.floatToIntBits(z); 158 + return result; 159 + } 160 + 161 + @Override 162 + public boolean equals(Object obj) 163 + { 164 + if (this == obj) 165 + return true; 166 + 167 + if (!(obj instanceof Vector3f) || obj == null) 168 + return false; 169 + 170 + Vector3f other = (Vector3f) obj; 171 + if (x == other.x && y == other.y && z == other.z) 172 + return true; 173 + 174 + return false; 175 + } 149 176 }
+5 -4
src/main/java/game/map/editor/commands/FuseVertices.java
··· 58 58 HashMap<Vertex, TriangleBatch> batchMap = new HashMap<>(); 59 59 60 60 for (Triangle t : triangles) { 61 - for (int i = 0; i < 3; i++) { 62 - vertexMap.put(new FusionWrapper(t.vert[i]), new FusionWrapper(t.vert[i])); 63 - batchMap.put(t.vert[i], t.parentBatch); 64 - oldVertices.add(t.vert[i]); 61 + for (Vertex v : t.vert) { 62 + FusionWrapper wrapped = new FusionWrapper(v); 63 + vertexMap.put(wrapped, wrapped); 64 + batchMap.put(v, t.parentBatch); 65 + oldVertices.add(v); 65 66 } 66 67 } 67 68