Automation.php:
Fixed a bug that could happened if two attacks hit two different targets (one with some traps and the other with 0 traps) at the same second.
Building.php:
Fixed the possibility to build a residence and a palace with the waiting loop (the previous fix wasn't working and $tid was used as a $id and viceversa).
Fixed the possibility to build in the id reserved to walls (id 40).
Fixed an error that could have shown if you had tried to build a not buildable building.
Buildings can no longer be built if in demolition.
Buildings can no longer be built above the max level (the previous fix was still hackable, through the waiting loop).
Fixed a bug that allowed to build resource fields in the village (the previous fix was still hackable)
Fixed a bug that allowed to build everything with the master builder (even the WW)
Fixed a bug that allowed to build over the twentieth level with the master builder
Fixed a bug that allowed to build level 0 building with the master builder by removing them from the construction queue
With this exploit you can build "infinite" building of the same type.
Reduced the file size from 1274 lines to 1072 lines.
Removed some unused variables.
Corrected some building requirements (Embassy, Academy, Stable, Walls).
When we don't have enough resources, the building level still got
increased when using master builder in the queue and then using instant
build.
Relates to #290
Relates to #257
Master builder cannot be used if we only have 2 gold and we chose to
insta-finish everything. In such case, master builder task will be
deleted instead of completed.
Fixes#264
Typing something like ```dorf2.php?a=25&id=20000&c=d6F``` where ```id=``` is the position in the village will get you an error if the id is higher than 40 ( not including WW id=99). ```Unknown column 'f20000t' in 'field list'```
So I added this restriction when building. Although it fixes the problem, you can still build at WW position, bugging your building and not being able to use, or demolish it.