forked from github/server
bug 2510 duplicate region after datafile read
This commit is contained in:
parent
c981bfb766
commit
6c11e740ff
2 changed files with 3 additions and 6 deletions
|
@ -775,10 +775,7 @@ region *new_region(int x, int y, struct plane *pl, int uid)
|
|||
region *r;
|
||||
|
||||
pnormalize(&x, &y, pl);
|
||||
r = rfindhash(x, y);
|
||||
if (!r) {
|
||||
r = region_create(uid);
|
||||
}
|
||||
r = region_create(uid);
|
||||
r->x = x;
|
||||
r->y = y;
|
||||
r->age = 1;
|
||||
|
|
|
@ -614,7 +614,7 @@ static void read_regioninfo(gamedata *data, const region *r, char *info, size_t
|
|||
|
||||
static region *readregion(gamedata *data, int x, int y)
|
||||
{
|
||||
region *r = findregion(x, y);
|
||||
region *r;
|
||||
const terrain_type *terrain;
|
||||
char name[NAMESIZE];
|
||||
char info[DISPLAYSIZE];
|
||||
|
@ -622,7 +622,7 @@ static region *readregion(gamedata *data, int x, int y)
|
|||
int n;
|
||||
|
||||
READ_INT(data->store, &uid);
|
||||
|
||||
r = findregionbyid(uid);
|
||||
if (r == NULL) {
|
||||
plane *pl = findplane(x, y);
|
||||
r = new_region(x, y, pl, uid);
|
||||
|
|
Loading…
Reference in a new issue