* fix for resource depletion updates to AnnotatedMap and Resource GoalMaps (cell to tile co-ord problem)
This commit is contained in:
parent
15b9aebb9f
commit
8579dbb36e
|
@ -143,6 +143,7 @@ void Cartographer::initResourceMap(ResourceMapKey key, PatchMap<1> *pMap) {
|
|||
|
||||
void Cartographer::onResourceDepleted(Vec2i pos, const ResourceType *rt) {
|
||||
PF_TRACE();
|
||||
pos = Map::toUnitCoords(pos);
|
||||
updateMapMetrics(pos, GameConstants::cellScale);
|
||||
resDirtyAreas[rt].push_back(pos);
|
||||
}
|
||||
|
|
|
@ -126,17 +126,17 @@ DebugRenderer::DebugRenderer() {
|
|||
showVisibleQuad =
|
||||
captureVisibleQuad =
|
||||
regionHilights =
|
||||
resourceMapOverlay =
|
||||
storeMapOverlay =
|
||||
showFrustum =
|
||||
captureFrustum =
|
||||
gridTextures =
|
||||
influenceMap =
|
||||
AAStarTextures =
|
||||
HAAStarOverlay =
|
||||
buildSiteMaps =
|
||||
false;
|
||||
|
||||
buildSiteMaps =
|
||||
AAStarTextures =
|
||||
resourceMapOverlay =
|
||||
true;
|
||||
}
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ void UnitUpdater::updateHarvest(Unit *unit){
|
|||
unit->setTargetPos(targetPos);
|
||||
command->setPos(targetPos);
|
||||
unit->setLoadCount(0);
|
||||
unit->setLoadType(map->getSurfaceCell(Map::toSurfCoords(unit->getTargetPos()))->getResource()->getType());
|
||||
unit->setLoadType(r->getType());
|
||||
}
|
||||
else{
|
||||
//if not continue walking
|
||||
|
@ -471,7 +471,7 @@ void UnitUpdater::updateHarvest(Unit *unit){
|
|||
if (r->decAmount(1)) {
|
||||
const ResourceType *rt = r->getType();
|
||||
sc->deleteResource();
|
||||
world->getCartographer()->onResourceDepleted(unit->getTargetPos(), rt);
|
||||
world->getCartographer()->onResourceDepleted(Map::toSurfCoords(unit->getTargetPos()), rt);
|
||||
unit->setCurrSkill(hct->getStopLoadedSkillType());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue