|
|
@ -184,12 +184,13 @@ bool API::InitMap()
|
|
|
|
d->offset_descriptor->resolveClassnameToVPtr("block_square_event_mineral",d->vein_mineral_vptr);
|
|
|
|
d->offset_descriptor->resolveClassnameToVPtr("block_square_event_mineral",d->vein_mineral_vptr);
|
|
|
|
|
|
|
|
|
|
|
|
// get the map pointer
|
|
|
|
// get the map pointer
|
|
|
|
uint32_t x_array_loc = g_pProcess->readDWord (map_offset);
|
|
|
|
uint32_t x_array_loc = g_pProcess->readDWord (map_offset);
|
|
|
|
//FIXME: very inadequate
|
|
|
|
//FIXME: very inadequate
|
|
|
|
if (!x_array_loc)
|
|
|
|
if (!x_array_loc)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Error::NoMapLoaded();
|
|
|
|
// bad stuffz happend
|
|
|
|
// bad stuffz happend
|
|
|
|
return false;
|
|
|
|
//return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint32_t mx, my, mz;
|
|
|
|
uint32_t mx, my, mz;
|
|
|
|
|
|
|
|
|
|
|
@ -201,7 +202,8 @@ bool API::InitMap()
|
|
|
|
// test for wrong map dimensions
|
|
|
|
// test for wrong map dimensions
|
|
|
|
if (mx == 0 || mx > 48 || my == 0 || my > 48 || mz == 0)
|
|
|
|
if (mx == 0 || mx > 48 || my == 0 || my > 48 || mz == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
throw Error::BadMapDimensions(mx, my);
|
|
|
|
|
|
|
|
//return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// alloc array for pointers to all blocks
|
|
|
|
// alloc array for pointers to all blocks
|
|
|
|