Codechange: Template DoCommand to automagically reflect the parameters of the command proc.

When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
This commit is contained in:
Michael Lutz
2021-10-30 01:31:46 +02:00
parent c88b104ec6
commit e740c24eb7
39 changed files with 320 additions and 229 deletions

View File

@@ -34,6 +34,7 @@
#include "terraform_cmd.h"
#include "zoom_func.h"
#include "rail_cmd.h"
#include "landscape_cmd.h"
#include "widgets/terraform_widget.h"
@@ -513,7 +514,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
/* Delete all station signs */
for (BaseStation *st : BaseStation::Iterate()) {
/* There can be buoys, remove them */
if (IsBuoyTile(st->xy)) DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, st->xy, 0, 0);
if (IsBuoyTile(st->xy)) Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC | DC_BANKRUPT, st->xy, 0, 0, {});
if (!st->IsInUse()) delete st;
}