Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all immobiles have no radar drift. #1831

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rts/Rendering/Units/UnitDrawerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ const icon::CIconData* CUnitDrawerData::GetUnitIcon(const CUnit* unit)
// use the unit's custom icon if we can currently see it,
// or have seen it before and did not lose contact since
bool unitVisible = ((losStatus & (LOS_INLOS | LOS_INRADAR)) && ((losStatus & prevMask) == prevMask));
unitVisible |= gameSetup->ghostedBuildings && unit->unitDef->IsBuildingUnit() && (losStatus & LOS_PREVLOS);
unitVisible |= gameSetup->ghostedBuildings && unit->unitDef->IsImmobileUnit() && (losStatus & LOS_PREVLOS);
const bool customIcon = (unitVisible || gu->spectatingFullView);

if (customIcon)
Expand Down Expand Up @@ -585,7 +585,7 @@ void CUnitDrawerData::RenderUnitDestroyed(const CUnit* unit)
const UnitDef* unitDef = unit->unitDef;
const UnitDef* decoyDef = unitDef->decoyDef;

const bool addNewGhost = unitDef->IsBuildingUnit() && gameSetup->ghostedBuildings;
const bool addNewGhost = unitDef->IsImmobileUnit() && gameSetup->ghostedBuildings;

// TODO - make ghosted buildings per allyTeam - so they are correctly dealt with
// when spectating
Expand Down Expand Up @@ -640,7 +640,7 @@ void CUnitDrawerData::UnitEnteredLos(const CUnit* unit, int allyTeam)
RECOIL_DETAILED_TRACY_ZONE;
CUnit* u = const_cast<CUnit*>(unit); //cleanup

if (gameSetup->ghostedBuildings && unit->unitDef->IsBuildingUnit())
if (gameSetup->ghostedBuildings && unit->unitDef->IsImmobileUnit())
spring::VectorErase(savedData.liveGhostBuildings[allyTeam][MDL_TYPE(unit)], u);

if (allyTeam != gu->myAllyTeam)
Expand All @@ -654,7 +654,7 @@ void CUnitDrawerData::UnitLeftLos(const CUnit* unit, int allyTeam)
RECOIL_DETAILED_TRACY_ZONE;
CUnit* u = const_cast<CUnit*>(unit); //cleanup

if (gameSetup->ghostedBuildings && unit->unitDef->IsBuildingUnit())
if (gameSetup->ghostedBuildings && unit->unitDef->IsImmobileUnit())
spring::VectorInsertUnique(savedData.liveGhostBuildings[allyTeam][MDL_TYPE(unit)], u, true);

if (allyTeam != gu->myAllyTeam)
Expand Down
2 changes: 1 addition & 1 deletion rts/Sim/Units/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ float3 CUnit::GetErrorVector(int argAllyTeam) const
const int atSightMask = losStatus[argAllyTeam];

const int isVisible = 2 * ((atSightMask & LOS_INLOS ) != 0 || teamHandler.Ally(argAllyTeam, allyteam)); // in LOS or allied, no error
const int seenGhost = 4 * ((atSightMask & LOS_PREVLOS) != 0 && gameSetup->ghostedBuildings && unitDef->IsBuildingUnit()); // seen ghosted building, no error
const int seenGhost = 4 * ((atSightMask & LOS_PREVLOS) != 0 && gameSetup->ghostedBuildings && unitDef->IsImmobileUnit()); // seen ghosted immobiles, no error
const int isOnRadar = 8 * ((atSightMask & LOS_INRADAR) != 0 ); // current radar contact

float errorMult = 0.0f;
Expand Down