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): let a wreck's salvage pile be picked up
Olcay Seygan784d879c87e2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5efd83ad4..ad6e78bba 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -533,6 +533,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- And anybody can take the money. A salvage crate could only be picked up by a unit that salvages, so one dropped among troops who could not use it was money that belonged to nobody. The parts still only go to a salvager - the weapon, the armour, the promotion - but the cash goes to whoever drives over it.- A crate pays once per frame, not once per soldier who touched it.- Crates pay again. In v2.2.0 no crate could be picked up at all: the Supply Drop Zone's parachute drop landed and sat there as boxes, and salvage and money crates stayed on the ground under the wheels that drove over them. The drop zone brings in its $1,500 every two minutes again, and a Humvee driven over a crate takes it.+- Salvage pays again. That pickup fix covered every crate marked as one, and the pile a wreck leaves was not among them, so a GLA tank's scrap sat on the ground under the wheels that drove over it. Driving over it takes it now: the parts go to a salvager, the cash to whoever gets there. A replay from before this, of a match where somebody drove over that pile, will not play back the same way.- A unit that kills something carrying a crate now goes for the crate. The game noted the crate, then forgot which one before it looked, so the "pick up what I just dropped" order at seven places in the code never once fired.- A thrown vehicle's crash damage hits the pile once, not once per unit.- A dying unit is no longer promoted by its last kill.diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cppindex 0f13c5a66..f4b95407b 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp@@ -189,7 +189,10 @@ Bool CrateCollide::isValidToExecute( const Object *other ) const// still touched its target before it was gone: a Paladin's laser shot the hijacker, and he left a// corpse and took the Paladin as well. A real crate has no health at all: its InactiveBody marks it// effectively dead from birth, so the test is for units only, or no crate in the game pays out.- if( !getObject()->isKindOf( KINDOF_CRATE ) && getObject()->isEffectivelyDead() )+ // SalvageCrate is the one crate that is not KINDOF_CRATE. It is selectable on purpose, and that+ // kindof is what keeps a dead thing from being clicked, so the kindof test alone left every wreck+ // pile sitting under the wheels that drove over it.+ if( !getObject()->isKindOf( KINDOF_CRATE ) && !isSalvageCrateCollide() && getObject()->isEffectivelyDead() )return FALSE;if( md->m_isForbidOwnerPlayer && (getObject()->getControllingPlayer() == other->getControllingPlayer()) )