OpenDUNE/OpenDUNE — pull request #193 by wangds (2013-02-15 03:01:33+00:00)
Title: Fix capturing logic

-Fix: capturing with deviated units did not unlock tech

Structure_GetStructuresBuilt is called with the unit's houseID rather than the structure's new owner's houseID/the unit's current owner. This means a deviated unit capturing a new structure does not properly unlock tech. Bug in the original game.

-Fix: windtrap power information incorrect after capturing a windtrap

The game keeps a windtrap count which is used to average the power output. This value is not adjusted when a windtrap is captured, so the average goes wrong. I decided to recount the windtraps in Structure_GetStructuresBuilt as that will also fix the count in existing saved games. Bug in original game, reported by MrFlibble.