// Doodads
for(int c=0; c<obj.mddf.getLenght(); c++) {
// witch is our MCNK tile?
MDDF_Entry dd = obj.mddf.entrys[c];
MCNK field = getLocationObj(
MODF_Entry.translate(dd.getX()),
MODF_Entry.translate(dd.getY())
);
if(field==null) {
System.err.println("DD " + c + " is located too far from this map. Skipped.");
}
else {
// dont forget to register it
field.mcrf.appendEntry(c);
// increase total numbers of objects there
int count = field.getNDoodad();
field.setNDoodad(count+1);
}
}
// WMO
for(int c=0; c<obj.modf.getLenght(); c++) {
// witch is our MCNK tile?
MODF_Entry ob = obj.modf.entrys[c];
MCNK field = getLocationObj(
MODF_Entry.translate(ob.getX()),
MODF_Entry.translate(ob.getY())
);
if(field==null) {
System.err.println("Object " + c + " is located too far from this map. Skipped.");
}
else {
// dont forget to register it
field.mcrf.appendEntry(c);
// increase total numbers of objects there
int count = field.getNObj();
field.setNObj(count+1);
}
}
}