fixed navigation tile issue, fixes #1581
This commit is contained in:
parent
e7ba4eca9f
commit
3fddc9e55a
1 changed files with 11 additions and 9 deletions
|
@ -406,17 +406,19 @@ void TileMap::_update_dirty_quadrants() {
|
||||||
|
|
||||||
if (navigation) {
|
if (navigation) {
|
||||||
Ref<NavigationPolygon> navpoly = tile_set->tile_get_navigation_polygon(c.id);
|
Ref<NavigationPolygon> navpoly = tile_set->tile_get_navigation_polygon(c.id);
|
||||||
Vector2 npoly_ofs = tile_set->tile_get_navigation_polygon_offset(c.id);
|
if (navpoly.is_valid()) {
|
||||||
Matrix32 xform;
|
Vector2 npoly_ofs = tile_set->tile_get_navigation_polygon_offset(c.id);
|
||||||
xform.set_origin(offset.floor()+q.pos);
|
Matrix32 xform;
|
||||||
_fix_cell_transform(xform,c,npoly_ofs+center_ofs,s);
|
xform.set_origin(offset.floor()+q.pos);
|
||||||
|
_fix_cell_transform(xform,c,npoly_ofs+center_ofs,s);
|
||||||
|
|
||||||
int pid = navigation->navpoly_create(navpoly,nav_rel * xform);
|
int pid = navigation->navpoly_create(navpoly,nav_rel * xform);
|
||||||
|
|
||||||
Quadrant::NavPoly np;
|
Quadrant::NavPoly np;
|
||||||
np.id=pid;
|
np.id=pid;
|
||||||
np.xform=xform;
|
np.xform=xform;
|
||||||
q.navpoly_ids[E->key()]=np;
|
q.navpoly_ids[E->key()]=np;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue