|
|
|
@ -1022,6 +1022,8 @@ bool API::ReadSettlement(const int32_t &index, t_settlement & settlement)
|
|
|
|
|
{
|
|
|
|
|
if(!d->settlementsInited)
|
|
|
|
|
return false;
|
|
|
|
|
if(!d->p_settlements->getSize())
|
|
|
|
|
return false;
|
|
|
|
|
// read pointer from vector at position
|
|
|
|
|
uint32_t temp = * (uint32_t *) d->p_settlements->at (index);
|
|
|
|
|
settlement.origin = temp;
|
|
|
|
@ -1034,11 +1036,13 @@ bool API::ReadCurrentSettlement(t_settlement & settlement)
|
|
|
|
|
{
|
|
|
|
|
if(!d->settlementsInited)
|
|
|
|
|
return false;
|
|
|
|
|
if(!d->p_current_settlement->getSize())
|
|
|
|
|
return false;
|
|
|
|
|
uint32_t temp = * (uint32_t *) d->p_current_settlement->at(0);
|
|
|
|
|
settlement.origin = temp;
|
|
|
|
|
g_pProcess->read(temp + d->settlement_name_offset, 2 * sizeof(int32_t), (uint8_t *) &settlement.name);
|
|
|
|
|
g_pProcess->read(temp + d->settlement_world_xy_offset, 2 * sizeof(int32_t), (uint8_t *) &settlement.world_x);
|
|
|
|
|
g_pProcess->read(temp + d->settlement_local_xy_offset, 4 * sizeof(int32_t), (uint8_t *) &settlement.local_x1);
|
|
|
|
|
g_pProcess->read(temp + d->settlement_world_xy_offset, 2 * sizeof(int16_t), (uint8_t *) &settlement.world_x);
|
|
|
|
|
g_pProcess->read(temp + d->settlement_local_xy_offset, 4 * sizeof(int16_t), (uint8_t *) &settlement.local_x1);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|