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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gameengine): route no tunnel trip through a foundation or a sale
Olcay Seygan215cf093f11b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d3a4ae962..43c8024dc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -400,7 +400,7 @@ found and fixed — EA's own, not port damage.**- Circular range checks are circles now, not the square drawn around them.- A tunnel network heals at one rate, however many entrances it has.-- GLA units take the tunnels on their own. Give a move order across the map, and if the way through your network is any shorter than the walk, the whole selection goes down the tunnel nearest it and comes up at the one nearest where you sent it, then walks the rest. An attack move does the same and comes up still attack-moving, and fresh units heading for a rally point across the map take the tunnels too, fighting on the way if they would have walked there fighting. The tunnels used to have to be almost a third shorter before anybody took them, so fresh units with a tunnel beside their barracks and one beside the rally point mostly walked anyway. Passing through does not count as resting: only units you put inside yourself are healed. The group decides together: fifteen Rebels with six places already taken all go through, where a first version sent ten underground and walked the other five. The green order line shows it: one line to the tunnel they go down and one from the tunnel they come up at to where you sent them. Twelve Rebels crossing a small map with a tunnel at each end got there in 21 seconds instead of 50, four Scorpions in 9 instead of 21. A tunnel that has just been hit is skipped, so nobody surfaces into the fire. The computer does it too: a GLA team losing a fight near one of its tunnels falls back underground and comes up at home, which happened 10 to 25 times a match in four Brutal GLA mirrors on Twilight Flame, and an attack wave takes the tunnels when they come up nearer your base than its road does. And the computer now digs them on purpose: a tunnel at home, one at the expansion it holds, and one three quarters of the way down the road its next wave will take, as long as nothing it has seen there can shoot. It does not wait for a fat bank to do it: a tunnel costs 800 and pays back on the first wave. In four Brutal GLA mirrors on Twilight Flame, 10 of 49 attack waves went underground, where none had before, and beaten teams fell back through a tunnel 250 times. Units you put in a tunnel yourself stay put, and a network they have filled is left alone: the order walks. With one place free, everybody still goes through it one after the other, since a unit passing through leaves the moment it arrives. Replays recorded before this change play out differently.+- GLA units take the tunnels on their own. Give a move order across the map, and if the way through your network is any shorter than the walk, the whole selection goes down the tunnel nearest it and comes up at the one nearest where you sent it, then walks the rest. An attack move does the same and comes up still attack-moving, and fresh units heading for a rally point across the map take the tunnels too, fighting on the way if they would have walked there fighting. The tunnels used to have to be almost a third shorter before anybody took them, so fresh units with a tunnel beside their barracks and one beside the rally point mostly walked anyway. Passing through does not count as resting: only units you put inside yourself are healed. The group decides together: fifteen Rebels with six places already taken all go through, where a first version sent ten underground and walked the other five. The green order line shows it: one line to the tunnel they go down and one from the tunnel they come up at to where you sent them. Twelve Rebels crossing a small map with a tunnel at each end got there in 21 seconds instead of 50, four Scorpions in 9 instead of 21. A tunnel that has just been hit is skipped, so nobody surfaces into the fire. So is one that is still a foundation or is being sold: a tunnel you had only just placed used to count straight away, and units sent across the map queued up at a building site. The computer does it too: a GLA team losing a fight near one of its tunnels falls back underground and comes up at home, which happened 10 to 25 times a match in four Brutal GLA mirrors on Twilight Flame, and an attack wave takes the tunnels when they come up nearer your base than its road does. And the computer now digs them on purpose: a tunnel at home, one at the expansion it holds, and one three quarters of the way down the road its next wave will take, as long as nothing it has seen there can shoot. It does not wait for a fat bank to do it: a tunnel costs 800 and pays back on the first wave. In four Brutal GLA mirrors on Twilight Flame, 10 of 49 attack waves went underground, where none had before, and beaten teams fell back through a tunnel 250 times. Units you put in a tunnel yourself stay put, and a network they have filled is left alone: the order walks. With one place free, everybody still goes through it one after the other, since a unit passing through leaves the moment it arrives. Replays recorded before this change play out differently.## The power bar tells the truthdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cppindex 5504be922..a5df85f70 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp@@ -269,6 +269,11 @@ Object *TunnelTracker::findQuietTunnelNear( const Coord3D *pos ) constif( tunnel == NULL || tunnel->isEffectivelyDead() )continue;+ // a tunnel joins the network the frame its foundation is laid, so a ghost nobody has built+ // yet, or one being sold, is on the list too; a unit sent there walked into the scaffolding+ if( tunnel->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION ) || tunnel->testStatus( OBJECT_STATUS_SOLD ) )+ continue;+// the stamp starts at 0xffffffff, which the sum wraps to just under the windowif( tunnel->getBodyModule()->getLastDamageTimestamp() + TUNNEL_UNDER_FIRE_FRAMES > now )continue;