|
|
@ -32,6 +32,7 @@ distribution.
|
|
|
|
#include "dfhack/VersionInfo.h"
|
|
|
|
#include "dfhack/VersionInfo.h"
|
|
|
|
#include "dfhack/DFProcess.h"
|
|
|
|
#include "dfhack/DFProcess.h"
|
|
|
|
#include "dfhack/DFVector.h"
|
|
|
|
#include "dfhack/DFVector.h"
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
|
|
|
|
#define SHMMAPSHDR ((Server::Maps::shm_maps_hdr *)d->d->shm_start)
|
|
|
|
#define SHMMAPSHDR ((Server::Maps::shm_maps_hdr *)d->d->shm_start)
|
|
|
|
#define SHMCMD(num) ((shm_cmd *)d->d->shm_start)[num]->pingpong
|
|
|
|
#define SHMCMD(num) ((shm_cmd *)d->d->shm_start)[num]->pingpong
|
|
|
@ -61,6 +62,8 @@ struct Maps::Private
|
|
|
|
bool hasFeatures;
|
|
|
|
bool hasFeatures;
|
|
|
|
bool hasVeggies;
|
|
|
|
bool hasVeggies;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set <uint32_t> unknown_veins;
|
|
|
|
|
|
|
|
|
|
|
|
// map between feature address and the read object
|
|
|
|
// map between feature address and the read object
|
|
|
|
map <uint32_t, t_feature> local_feature_store;
|
|
|
|
map <uint32_t, t_feature> local_feature_store;
|
|
|
|
|
|
|
|
|
|
|
@ -567,8 +570,7 @@ bool Maps::ReadVeins(uint32_t x, uint32_t y, uint32_t z, vector <t_vein>* veins,
|
|
|
|
if(constructions) constructions->clear();
|
|
|
|
if(constructions) constructions->clear();
|
|
|
|
|
|
|
|
|
|
|
|
Server::Maps::maps_offsets &off = d->offsets;
|
|
|
|
Server::Maps::maps_offsets &off = d->offsets;
|
|
|
|
if (addr)
|
|
|
|
if (!addr) return false;
|
|
|
|
{
|
|
|
|
|
|
|
|
// veins are stored as a vector of pointers to veins
|
|
|
|
// veins are stored as a vector of pointers to veins
|
|
|
|
/*pointer is 4 bytes! we work with a 32bit program here, no matter what architecture we compile khazad for*/
|
|
|
|
/*pointer is 4 bytes! we work with a 32bit program here, no matter what architecture we compile khazad for*/
|
|
|
|
DfVector <uint32_t> p_veins (p, addr + off.veinvector);
|
|
|
|
DfVector <uint32_t> p_veins (p, addr + off.veinvector);
|
|
|
@ -579,7 +581,6 @@ bool Maps::ReadVeins(uint32_t x, uint32_t y, uint32_t z, vector <t_vein>* veins,
|
|
|
|
// read the vein pointer from the vector
|
|
|
|
// read the vein pointer from the vector
|
|
|
|
uint32_t temp = p_veins[i];
|
|
|
|
uint32_t temp = p_veins[i];
|
|
|
|
uint32_t type = p->readDWord(temp);
|
|
|
|
uint32_t type = p->readDWord(temp);
|
|
|
|
try_again:
|
|
|
|
|
|
|
|
if(veins && type == off.vein_mineral_vptr)
|
|
|
|
if(veins && type == off.vein_mineral_vptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// read the vein data (dereference pointer)
|
|
|
|
// read the vein data (dereference pointer)
|
|
|
@ -644,16 +645,16 @@ try_again:
|
|
|
|
off.vein_worldconstruction_vptr = type;
|
|
|
|
off.vein_worldconstruction_vptr = type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // this is something we've never seen before
|
|
|
|
else // this is something we've never seen before
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!d->unknown_veins.count(type))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cerr << "unknown vein " << cname << hex << " 0x" << temp << " block: 0x" << addr << dec << endl;
|
|
|
|
cerr << "unknown vein " << cname << hex << " 0x" << temp << " block: 0x" << addr << dec << endl;
|
|
|
|
|
|
|
|
d->unknown_veins.insert(type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
goto try_again;
|
|
|
|
|
|
|
|
// or it was something we don't care about
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|