- bugfix for selection circle on units on the edge of map cells

This commit is contained in:
Mark Vejvoda 2011-02-23 21:54:51 +00:00
parent 16c7316887
commit d300c5635b
1 changed files with 14 additions and 0 deletions

View File

@ -2660,6 +2660,13 @@ void Renderer::renderSelectionEffects() {
}
else {
Vec2i pos= c->getPos();
if(pos.x < 0) {
pos.x = 0;
}
if(pos.y < 0) {
pos.y = 0;
}
arrowTarget= Vec3f(pos.x, map->getCell(pos)->getHeight(), pos.y);
}
@ -2670,6 +2677,13 @@ void Renderer::renderSelectionEffects() {
//meeting point arrow
if(unit->getType()->getMeetingPoint()) {
Vec2i pos= unit->getMeetingPos();
if(pos.x < 0) {
pos.x = 0;
}
if(pos.y < 0) {
pos.y = 0;
}
Vec3f arrowTarget= Vec3f(pos.x, map->getCell(pos)->getHeight(), pos.y);
renderArrow(unit->getCurrVectorFlat(), arrowTarget, Vec3f(0.f, 0.f, 1.f), 0.3f);
}