forked from github/server
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:
parent
f56265c589
commit
918057aa90
|
@ -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", ®ion_setflag)
|
||||
|
||||
.def("remove", ®ion_remove)
|
||||
.def("move", ®ion_move)
|
||||
|
||||
.def("get_road", ®ion_getroad)
|
||||
.def("set_road", ®ion_setroad)
|
||||
|
|
Loading…
Reference in New Issue