Implemented forge logic
+ fixed warning seen by @akien-mga

fixes #353
Changes as requested by @Bertram25 and @oyvindln
Fixed a crash when the AI gets a treasury destroyed and tries to rebuild it within the same turn

To reproduce it easily, the easiest is to disable the cooldown for AI when checking for treasuries. And attack it.
Fixed mistake and comment asked by @Bertram25
Merge pull request #365 from hwoarangmy/development

Implemented forge logic