Skip to content

Commit

Permalink
Fix #5267 #5268
Browse files Browse the repository at this point in the history
Always draw icons for ghosted buildings (disregard zoom level).
Update INLOS and CONTRADAR for nanoframes.
  • Loading branch information
ashdnazg committed Jun 6, 2016
1 parent ae599bc commit 7b39a62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
7 changes: 1 addition & 6 deletions rts/Rendering/UnitDrawer.cpp
Expand Up @@ -1436,13 +1436,8 @@ inline void CUnitDrawer::UpdateUnitIconState(CUnit* unit) {
// reset
unit->isIcon = losStatus & LOS_INRADAR;

if ((losStatus & LOS_INLOS) || gu->spectatingFullView) {
if ((losStatus & LOS_INLOS) || gu->spectatingFullView)
unit->isIcon = DrawAsIcon(unit, (unit->pos - camera->GetPos()).SqLength());
} else if ((losStatus & LOS_PREVLOS) && (losStatus & LOS_CONTRADAR)) {
if (gameSetup->ghostedBuildings && unit->unitDef->IsImmobileUnit()) {
unit->isIcon = DrawAsIcon(unit, (unit->pos - camera->GetPos()).SqLength());
}
}

if (!unit->isIcon)
return;
Expand Down
11 changes: 2 additions & 9 deletions rts/Sim/Units/Unit.cpp
Expand Up @@ -952,15 +952,8 @@ unsigned short CUnit::CalcLosStatus(int at)
unsigned short mask = ~(currStatus >> 8);

if (losHandler->InLos(this, at)) {
if (!beingBuilt) {
newStatus |= (mask & (LOS_INLOS | LOS_INRADAR |
LOS_PREVLOS | LOS_CONTRADAR));
} else {
// we are being built, do not set LOS_PREVLOS
// since we do not want ghosts for nanoframes
newStatus |= (mask & (LOS_INLOS | LOS_INRADAR));
newStatus &= ~(mask & (LOS_PREVLOS | LOS_CONTRADAR));
}
newStatus |= (mask & (LOS_INLOS | LOS_INRADAR |
LOS_PREVLOS | LOS_CONTRADAR));
}
else if (losHandler->InRadar(this, at)) {
newStatus |= (mask & LOS_INRADAR);
Expand Down

0 comments on commit 7b39a62

Please sign in to comment.