Skip to content

Commit

Permalink
Mex: Update neighbors when reclaimed in nanoframe (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
badosu authored Nov 26, 2022
1 parent 801cd6d commit f9679c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rts/Sim/Units/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "UnitMemPool.h"
#include "UnitToolTipMap.hpp"
#include "UnitTypes/Building.h"
#include "UnitTypes/ExtractorBuilding.h"
#include "Scripts/NullUnitScript.h"
#include "Scripts/UnitScriptFactory.h"
#include "Scripts/CobInstance.h" // for TAANG2RAD
Expand Down Expand Up @@ -1981,6 +1982,12 @@ bool CUnit::AddBuildPower(CUnit* builder, float amount)
beingBuilt = true;
SetMetalStorage(0);
SetEnergyStorage(0);

// make sure neighbor extractors update
CExtractorBuilding* extractor = dynamic_cast<CExtractorBuilding*>(this);
if (extractor != nullptr)
extractor->ResetExtraction();

eventHandler.UnitReverseBuilt(this);
}

Expand Down

0 comments on commit f9679c3

Please sign in to comment.