Man kann von lua aus regionen versetzen. Ich muss mal wieder Weltkosmetik betreiben, weild er Mapper Dinge in alte Welten setzt.

This commit is contained in:
Enno Rehling 2005-01-03 22:09:33 +00:00
parent f56265c589
commit 918057aa90
1 changed files with 27 additions and 0 deletions

View File

@ -187,12 +187,38 @@ region_remove(region& r)
}
}
#endif
runhash(&r);
break;
}
rp = &(*rp)->next;
}
}
void
region_move(region& r, int x, int y)
{
#ifdef FAST_CONNECT
direction_t dir;
for (dir=0;dir!=MAXDIRECTIONS;++dir) {
region * rn = r.connect[dir];
if (rn!=NULL) {
direction_t reldir = reldirection(rn, &r);
rn->connect[reldir] = NULL;
}
rn = findregion(x+delta_x[dir], y+delta_y[dir]);
if (rn!=NULL) {
direction_t reldir = reldirection(rn, &r);
rn->connect[reldir] = &r;
}
r.connect[dir] = rn;
}
#endif
runhash(&r);
r.x = x;
r.y = y;
rhash(&r);
}
void
bind_region(lua_State * L)
{
@ -214,6 +240,7 @@ bind_region(lua_State * L)
.def("set_flag", &region_setflag)
.def("remove", &region_remove)
.def("move", &region_move)
.def("get_road", &region_getroad)
.def("set_road", &region_setroad)