This commit fixes two small visual bugs within the KOTH/CP gametype and moves a supported feature from the map blocks themselves to the JSON map configuration.
A small scoreboard visual bug was fixed where once hill control is lost and progress is at 0%, the scoreboard line would still color the hill name with the previous controller's team color. This happened because the scoreboard lines were updated before controller was set to null.
Hills without initial owners will all by default be colored white. This change had to be made because otherwise, a visual bug was possible: If a hill which never was captured before is advanced to let's say 30%, the blocks will be colored accordingly. 30% of the hill will be the capturing team's color, with the remaining 70% not being affected at all/remaining neutral. If the other team manages to stop the original team from advancing its progress before it reaches 100% and starts to reverse it, the hill's blocks would end up not updating their colors correctly. The solution I used was to simply "move" this feature of letting the map authors define the neutral hill color from the original hill block colors of the map to the JSON. All hills will be colored once the KOTHModule is loaded. The koth object accepts a new key, named neutral-color which accepts a chat color as input. This will be the default neutral hill color for the map. If not defined in the JSON, the default hill color is hardcoded to white. Hills can override the default neutral hill color by passing a chat color to the same neutral-color within a hill object.
This commit fixes two small visual bugs within the KOTH/CP gametype and moves a supported feature from the map blocks themselves to the JSON map configuration.
koth
object accepts a new key, namedneutral-color
which accepts a chat color as input. This will be the default neutral hill color for the map. If not defined in the JSON, the default hill color is hardcoded to white. Hills can override the default neutral hill color by passing a chat color to the sameneutral-color
within a hill object.Tested.