Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int addedObj = 0;
- int objID = -1;//-1;
- do
- {
- int objOffset = 0;//object ids are not stored, just the difference from the last one
- if (addedObj == 0)
- objOffset = objectId[addedObj] + 1;
- else if (addedObj == totalObjects)
- {//reach the end
- objOffset = 0;
- }
- else
- {
- objOffset = (objectId[addedObj] - objectId[addedObj - 1]);
- }
- data.writeSmart((byte)37, objOffset);
- if (objOffset == 0)//stops writting
- break;
- int j1 = 0;
- objID += objOffset;
- do
- {
- int height1 = height[addedObj];
- int localY1 = objectY[addedObj];
- int localX1 = objectX[addedObj];
- int type1 = type[addedObj];
- int face1 = face[addedObj];
- int y = 0;
- int x = 0;
- int k1 = 0;
- int type_face = 0;
- int tempj1 = 0;
- tempj1 += localY1;
- tempj1 += localX1 << 6;
- tempj1 += height1 << 12;
- k1 = (tempj1 - j1) + 1;
- j1 = tempj1;
- data.writeSmart((byte)37, k1);
- type_face = (type1 << 2) + face1;
- data.writeByte(type_face);
- if (objectId[addedObj + 1] > objectId[addedObj] || addedObj + 1 == totalObjects)
- {
- addedObj++;
- data.writeSmart((byte)37, 0);
- break;
- }
- else
- {
- addedObj++;
- }
- } while (true);
- } while (true);
- data.writeFile("F:/"+mapId+".dat", data.GetBytesFromList());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement