Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gameengine): re-look when a plan takes its first build percent

Olcay Seyganb84d1d23ec55
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd555fc83..2b0dc354e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -551,7 +551,7 @@ found and fixed — EA's own, not port damage.**
- Cancelling a placement no longer deselects the builder.
- The building on your cursor shows where its units will come out.
- An ordered building stands as a see-through plan until a worker starts it.
-- A building going up lifts the fog around it the moment work starts. It used to see no further than its own walls until the last brick was in, so a base built out into the fog stood blind for the whole build and the worker on the site saw more than the site did.
+- A building going up lifts the fog around it the moment work starts. It used to see no further than its own walls until the last brick was in, so a base built out into the fog stood blind for the whole build and the worker on the site saw more than the site did. Until this version it still did, whatever this line said: the building worked out its new sight the moment work started and then never looked again until it was finished.
- Click a plan, or press Stop, to cancel it and take the money back.
- Cancelling a plan is silent — nothing was built, so nothing explodes.
- Ground your units have walked stays buildable after they leave it.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp
index 26dee8b0a..da662dba1 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp
@@ -3400,6 +3400,10 @@ void Object::setConstructionPercent( Real percent )
TheAI->pathfinder()->addObjectToPathfindMap( this );
+ // the plan looked with no range when it was placed and nothing re-looks a structure that does
+ // not move, so without this the site stayed blind until the last percent went in
+ handleShroud();
+
//
// and the building starts putting itself up. This is the same frame the silhouette goes
// solid (Drawable::getEffectiveOpacity asks Object_isAwaitingBuilder, which asks this very